ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,280
- Office Version
- 2007
- Platform
- Windows
Evening,
I touched on this earlier but got side tracked.
I am currently using the working code below but the only thing is, the file that will accept the pasted values must also be open.
I would only like at the start to have the active worksheet open.
I would press the command button & the extra piece of code required would open the workbook called TOTALS,then the current working code below would do the copy & paste part & then close the workbook TOTALS.
I touched on this earlier but got side tracked.
I am currently using the working code below but the only thing is, the file that will accept the pasted values must also be open.
I would only like at the start to have the active worksheet open.
I would press the command button & the extra piece of code required would open the workbook called TOTALS,then the current working code below would do the copy & paste part & then close the workbook TOTALS.
Code:
Private Sub CommandButton2_Click() Dim Answer As Long
Answer = MsgBox("Transfer Values To Summary Sheet ?", vbYesNo + vbInformation, "End Of Month Accounts")
If Answer = vbYes Then
Workbooks("ACCOUNTS").Sheets("INCOME1").Range("E32").Copy
Workbooks("SUMMARY 2018 - 2019").Sheets("Sheet1").Range("I26").PasteSpecial xlPasteValues
Workbooks("ACCOUNTS").Sheets("INCOME1").Range("F32").Copy
Workbooks("SUMMARY 2018 - 2019").Sheets("Sheet1").Range("I27").PasteSpecial xlPasteValues
ActiveWorkbook.Save
End If
End Sub