Hi
I have the following macro that im trying to run automatically as soon as I click the save button but it keeps asking if I want to replace and then crashes.
Ive put in workbook/before save in the VBA, Im trying to get it to go to sheet called RUNNING TOTALS and update that before saving in the 2 locations in the macro.
One other thing I got and dont know if you can add to it where I have it go to running totals to update sheet can I get to go back to the sheet that I was last using. That bit I know if defentally not in the macro.
Any ideas?
Thanks
I have the following macro that im trying to run automatically as soon as I click the save button but it keeps asking if I want to replace and then crashes.
Ive put in workbook/before save in the VBA, Im trying to get it to go to sheet called RUNNING TOTALS and update that before saving in the 2 locations in the macro.
One other thing I got and dont know if you can add to it where I have it go to running totals to update sheet can I get to go back to the sheet that I was last using. That bit I know if defentally not in the macro.
Any ideas?
Thanks
VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveWorkbook.save
Sheets("RUNNING TOTALS").Select
ActiveWorkbook.save
ActiveWorkbook.SaveAs Filename:= _
"T:\Passenger Accounts\Surplus & Loss WA\Surplus & Loss WA P2101 ONWARDS.xlsb" _
, FileFormat:=xlExcel12, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:= _
"[URL='https://arrivagroup.sharepoint.com/teams/MANAGERSSURPLOSSERRORLOG/Shared%20Documents/General/Surplus%20&%20Loss%20WA%20P2101%20ONWARDS.xlsb']https://arrivagroup.sharepoint.com/teams/MANAGERSSURPLOSSERRORLOG/Shared Documents/General/Surplus & Loss WA P2101 ONWARDS.xlsb[/URL]" _
, FileFormat:=xlExcel12, CreateBackup:=False
ActiveWorkbook.save
End Sub
Last edited by a moderator: