ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   More Worksheet and Copy Pase help (https://www.excelbanter.com/excel-programming/298990-more-worksheet-copy-pase-help.html)

No Name

More Worksheet and Copy Pase help
 
I have a comand that works just fine for copying and
pasting within a single worksheet. In the following
code, I want the E2:H data to be in sheet2 and I want the
A2:D data to be from sheet 1. How would I incorporate
that? Thank you.



Range("E2:H" & FinalRow).Value = Range("A2:D" &
FinalRow).Value


Frank Kabel

More Worksheet and Copy Pase help
 
Hi
try
dim wks_1 as worksheet
dim wks_2 as worksheet
set wks_1 = activeworkbook.worksheets("sheet1")
set wks_1= activeworkbook.worksheets("sheet2")
'....
wks_2.Range("E2:H" & FinalRow).Value = wks_1.Range("A2:D" &
FinalRow).Value

--
Regards
Frank Kabel
Frankfurt, Germany

schrieb im Newsbeitrag
...
I have a comand that works just fine for copying and
pasting within a single worksheet. In the following
code, I want the E2:H data to be in sheet2 and I want the
A2:D data to be from sheet 1. How would I incorporate
that? Thank you.



Range("E2:H" & FinalRow).Value = Range("A2:D" &
FinalRow).Value




All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com