Copy data from current work to another
Solved/Closed
Sushil Gaikwad
Posts
1
Registration date
Tuesday February 11, 2014
Status
Member
Last seen
February 11, 2014
-
Feb 11, 2014 at 06:49 AM
Sush - Feb 14, 2014 at 07:00 AM
Sush - Feb 14, 2014 at 07:00 AM
Related:
- Copy data from current work to another
- Transfer data from one excel worksheet to another automatically - Guide
- Tmobile data check - Guide
- Fire current casino - Download - Online gaming and betting
- Gta 5 data download for pc - Download - Action and adventure
- Digital data transmission - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Feb 11, 2014 at 11:13 AM
Feb 11, 2014 at 11:13 AM
Hi Sushil,
The following code will copy the data from the active workbook (columns A:D minus the header row). Then a closed workbook of your choosing will be opened. Copied data will be pasted in the first available row. Workbook will be closed and changes will be saved.
Best regards,
Trowa
The following code will copy the data from the active workbook (columns A:D minus the header row). Then a closed workbook of your choosing will be opened. Copied data will be pasted in the first available row. Workbook will be closed and changes will be saved.
Sub RunMe()
Dim lRow As Integer
lRow = Range("A1").End(xlDown).Row
Range("A2:D" & lRow).Copy
Workbooks.Open "C:\MyFiles\Test.xls" 'Change file path to match yours
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial
ActiveWorkbook.Close SaveChanges:=True
Application.CutCopyMode = False
End Sub
Best regards,
Trowa
Feb 14, 2014 at 07:00 AM