rhombus4
Well-known Member
- Joined
- May 26, 2010
- Messages
- 586
- Office Version
- 365
- 2016
- Platform
- Windows
have a spreadsheet called Book1, then transfer data to Test.
In test it calcualtes some figures which i then want to transfer back to Book1 before closing Test. Not sure where to put the code to copy from Test.xls Sheet3 A1:D1 then copy it to the initial Book.xls Sheet 1 A30:d30
NewName = ActiveWorkbook.Name
Workbooks.Open "C:My Docs\Test.xls.xls"
Workbooks(NewName).Sheets("Sheet1").Range("A101:C101").Copy
Workbooks("Test.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
'Save and close Test Spreadsheet
ActiveWorkbook.Save
ActiveWindow.Close
Workbooks(NewName).Activate
CutCopyMode = False
ThisWorkbook.Activate
Sheets("Sheet1").Select
Range("A1").Select
End Sub
In test it calcualtes some figures which i then want to transfer back to Book1 before closing Test. Not sure where to put the code to copy from Test.xls Sheet3 A1:D1 then copy it to the initial Book.xls Sheet 1 A30:d30
NewName = ActiveWorkbook.Name
Workbooks.Open "C:My Docs\Test.xls.xls"
Workbooks(NewName).Sheets("Sheet1").Range("A101:C101").Copy
Workbooks("Test.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
'Save and close Test Spreadsheet
ActiveWorkbook.Save
ActiveWindow.Close
Workbooks(NewName).Activate
CutCopyMode = False
ThisWorkbook.Activate
Sheets("Sheet1").Select
Range("A1").Select
End Sub