PC Review


Reply
Thread Tools Rate Thread

Copy Variable Range to New Worksheet

 
 
=?Utf-8?B?bm9zcGFtaW5saWNo?=
Guest
Posts: n/a
 
      3rd Aug 2007
I'm trying to copy a variable range from A1:C ? (the last populated cell in
the range) of Sheet1 to the first available cell in Col A in Sheet 3

I've tried loads of things but none have worked. This is my latest attempt
but I get a Run-time error '424' Object required message....

Dim NextRow As Long
With Worksheets("Sheet3")
NextRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
Set grng = Range("A1:C1" & Range("C65536").End(xlUp).Row)
grng.Copy _
Destination:=Worksheets("Sheet3").Cells(NextRow, "A")
End With


I'd appreciate some help with the code ass I've run out of ideas now.

Many thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      3rd Aug 2007
with Sheets("Sheet1")
..range(.range("A1"), .cells(rows.count, "C").end(xlup)).copy _
Destination:=Sheets("Sheet3").Cells(rows.count, "A").end(xlup).offset(1, 0)
end with
--
HTH...

Jim Thomlinson


"nospaminlich" wrote:

> I'm trying to copy a variable range from A1:C ? (the last populated cell in
> the range) of Sheet1 to the first available cell in Col A in Sheet 3
>
> I've tried loads of things but none have worked. This is my latest attempt
> but I get a Run-time error '424' Object required message....
>
> Dim NextRow As Long
> With Worksheets("Sheet3")
> NextRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
> Set grng = Range("A1:C1" & Range("C65536").End(xlUp).Row)
> grng.Copy _
> Destination:=Worksheets("Sheet3").Cells(NextRow, "A")
> End With
>
>
> I'd appreciate some help with the code ass I've run out of ideas now.
>
> Many thanks

 
Reply With Quote
 
=?Utf-8?B?bm9zcGFtaW5saWNo?=
Guest
Posts: n/a
 
      3rd Aug 2007
Many thanks Jim that's great. On to Phase 2 now!
 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      3rd Aug 2007
Just so you know you had 2 issues in what you posted...
Set grng = Range("A1:C1" & Range("C65536").End(xlUp).Row)
Is not reference to sheet1 and there should be no 1 after :C
--
HTH...

Jim Thomlinson


"nospaminlich" wrote:

> Many thanks Jim that's great. On to Phase 2 now!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using =COUNTIF() in a variable range on a different worksheet? circuit_breaker Microsoft Excel Worksheet Functions 4 6th Jul 2009 07:56 PM
Declaring a variable as a range in another worksheet peturg@gmail.com Microsoft Excel Programming 5 8th Apr 2007 05:46 AM
Macro to copy a specified range to a variable range SWT Microsoft Excel Programming 4 21st Oct 2005 08:24 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 2 22nd Sep 2004 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 0 22nd Sep 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:02 PM.