LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying Variable Ranges

With Worksheets("Sheet2")
..Range(.Range("C1"), .Range("H1").End(xlDown)).Copy
End With
Range("K7").PasteSpecial

You need to qualify all range references to point to sheet2.

--
Regards,
Tom Ogilvy

"Alec" wrote in message
...
The following code works for copying a range from C1 up to
the first blank in column H;

Range("C1", Range("H1").End(xlDown)).Copy
Range("K7").PasteSpecial

But when I try the following code to copy the same amount
of data from sheet 2 I get an error message.

Worksheets("Sheet2").Range("C1", Range("H1").End
(xlDown)).Copy
Range("K7").PasteSpecial
Any ideas.
Thanks
Alec



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
variable ranges gramps Excel Discussion (Misc queries) 4 February 4th 10 02:33 PM
Help with Variable Ranges! Nelson B. Excel Discussion (Misc queries) 1 August 21st 08 03:30 PM
Variable Ranges Erika Excel Worksheet Functions 1 November 30th 07 09:21 PM
Variable ranges John Contact Excel Worksheet Functions 1 June 17th 05 08:02 AM
Sum Variable Ranges Erika Excel Worksheet Functions 6 December 23rd 04 03:52 PM


All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"