ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
I have a worksheet that stores all my income / expenses etc & is currently named SUMMARY SHEET 2024-2025.xlsm
I have a workbook which has worksheets like Income 1 Income 2 etc & also Expenses1 Expenses 2 etc etc
When each month ends i send the values from each active sheet of its kind to the summary sheet.
When the new tax year starts i rename the summary sheet with its new current year
My issue is then i need to change each income / expenses sheet also for the new year date of which takes time.
I thought last night to have the 1 code & put in a module & call that module to run that code,thus me only having to change the date once as opposed to many but that didnt work as in the code each sheet name is referenced like INCOME(1) etc etc
Here is the code for Income 1 to show you what i mean.
Do you see a way for me to minimise my work in respect of dates etc.
I have a workbook which has worksheets like Income 1 Income 2 etc & also Expenses1 Expenses 2 etc etc
When each month ends i send the values from each active sheet of its kind to the summary sheet.
When the new tax year starts i rename the summary sheet with its new current year
My issue is then i need to change each income / expenses sheet also for the new year date of which takes time.
I thought last night to have the 1 code & put in a module & call that module to run that code,thus me only having to change the date once as opposed to many but that didnt work as in the code each sheet name is referenced like INCOME(1) etc etc
Here is the code for Income 1 to show you what i mean.
Do you see a way for me to minimise my work in respect of dates etc.
VBA Code:
Private Sub CommandButton2_Click()
Dim answer As Long, wb As Workbook
answer = MsgBox("ONLY TRANSFER FIGURES IF ITS THE END OF THE MONTH" & vbNewLine & "" & vbNewLine & "***** DO WE CONTINUE TO TRANSFER THE FIGURES ? *****", vbYesNo + vbCritical, "END OF MONTH TRANSFER QUESTION")
If answer = vbYes Then
Set wb = Workbooks.Open(FileName:="C:\Users\Ian\Desktop\EBAY\ACCOUNTS\CURRENT SHEETS\SUMMARY SHEET 2024-2025.xlsm")
Workbooks("ACCOUNTS.xlsm").Sheets("INCOME (1)").Range("E32").Copy
wb.Sheets("SUMMARY SHEET").Range("I9").PasteSpecial xlPasteValues
Workbooks("ACCOUNTS.xlsm").Sheets("INCOME (1)").Range("F32").Copy
wb.Sheets("SUMMARY SHEET").Range("I10").PasteSpecial xlPasteValues
wb.Close True
Else
Exit Sub
End If
Workbooks("ACCOUNTS.xlsm").Sheets("INCOME (1)").Range("A5").Select
Application.CutCopyMode = False
MsgBox "SUMMARY TRANSFER COMPLETED", vbInformation, "SUCCESSFUL MESSAGE"
ActiveWorkbook.Save
End Sub