Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
This works fine with more than one row, but if the second row is empty, I get the first three rows pasted instead of just the first. Also if I just have one row I get the whole 65536 rows. Any ideas how this could be avoided. Thanks Again Alec -----Original Message----- 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 . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Worksheets("Sheet2")
..Range(.Range("C1"), .Range("H65536").End(xlUp)).Copy End With Range("K7").PasteSpecial -- Regards, Tom Ogilvy "Alec" wrote in message ... Thanks Tom This works fine with more than one row, but if the second row is empty, I get the first three rows pasted instead of just the first. Also if I just have one row I get the whole 65536 rows. Any ideas how this could be avoided. Thanks Again Alec -----Original Message----- 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 . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Again Tom
-----Original Message----- With Worksheets("Sheet2") ..Range(.Range("C1"), .Range("H65536").End(xlUp)).Copy End With Range("K7").PasteSpecial -- Regards, Tom Ogilvy "Alec" wrote in message ... Thanks Tom This works fine with more than one row, but if the second row is empty, I get the first three rows pasted instead of just the first. Also if I just have one row I get the whole 65536 rows. Any ideas how this could be avoided. Thanks Again Alec -----Original Message----- 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 . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
variable ranges | Excel Discussion (Misc queries) | |||
Help with Variable Ranges! | Excel Discussion (Misc queries) | |||
Variable Ranges | Excel Worksheet Functions | |||
Variable ranges | Excel Worksheet Functions | |||
Sum Variable Ranges | Excel Worksheet Functions |