Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How do I make a macro that copies data from one spreadsheet and then pastes it into another spreadsheet, BUT does not paste over the top of the existing data and pastes a row lower? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Burg,
The following copies A1:D6 on Sheet1 to a range on Sheet2 starting at the next empty cell in column A. Sub Demo() Dim srcRng As Range, destRng As Range Set srcRng = Sheets("Sheet1").Range("A1:D6") Set destRng = Sheets("Sheet2"). _ Cells(Rows.Count, "A").End(xlUp)(2) srcRng.Copy destRng End Sub --- Regards, Norman "burg" wrote in message ... Hello, How do I make a macro that copies data from one spreadsheet and then pastes it into another spreadsheet, BUT does not paste over the top of the existing data and pastes a row lower? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Norman,
Just wondering how you specify a file path. I want to paste the data into another spreadsheet. It is in the same folder so does this make it easier? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Burg,
Try something like: Sub Demo02() Dim srcRng As Range, destRng As Range Dim WB1 As Workbook, WB2 As Workbook Set WB1 = Workbooks("MySourceBook.xls") Set WB2 = Workbooks("MyDestinationBook.xls") Set srcRng = WB1.Sheets("Sheet1").Range("A1:D6") Set destRng = WB2.Sheets("Sheet1"). _ Cells(Rows.Count, "A").End(xlUp)(2) srcRng.Copy destRng End Sub --- Regards, Norman "burg" wrote in message ... Thanks Norman, Just wondering how you specify a file path. I want to paste the data into another spreadsheet. It is in the same folder so does this make it easier? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect. Thanks
"Norman Jones" wrote: Hi Burg, Try something like: Sub Demo02() Dim srcRng As Range, destRng As Range Dim WB1 As Workbook, WB2 As Workbook Set WB1 = Workbooks("MySourceBook.xls") Set WB2 = Workbooks("MyDestinationBook.xls") Set srcRng = WB1.Sheets("Sheet1").Range("A1:D6") Set destRng = WB2.Sheets("Sheet1"). _ Cells(Rows.Count, "A").End(xlUp)(2) srcRng.Copy destRng End Sub --- Regards, Norman "burg" wrote in message ... Thanks Norman, Just wondering how you specify a file path. I want to paste the data into another spreadsheet. It is in the same folder so does this make it easier? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert lotus 123w macros to excel macros | Excel Programming | |||
convert lotus 123w macros to excel macros | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming | |||
Macro Size Limit / open macros with macros? | Excel Programming | |||
Macros not appearing in the Tools Macro Macros list | Excel Programming |