Hi
Sorry if my terminology isn’t correct I’m quite new to this, I’m stuck trying to get the below 2 actions to run one after another.
When a user attempts to save, a msgbox will appear saying “Nope no saving I’m afraid!” with only 1 option to cancel.
When the user click cancel I want the workbook to change from the active sheet to another sheet in the same workbook.
Can this be done?
Below is the code I’ve been messing around with but as I said I’m very new and pretty stuck lol.
Many thanks in advance.
Also the title might not be best suited for this request, If you can suggest something else it may help
somebody looking for something similar find it easier
Sorry if my terminology isn’t correct I’m quite new to this, I’m stuck trying to get the below 2 actions to run one after another.
When a user attempts to save, a msgbox will appear saying “Nope no saving I’m afraid!” with only 1 option to cancel.
When the user click cancel I want the workbook to change from the active sheet to another sheet in the same workbook.
Can this be done?
Below is the code I’ve been messing around with but as I said I’m very new and pretty stuck lol.
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "Nope no saving I'm afraid!", , "Your request has been denied!"
Cancel = True
End Sub
Sub Activate_Workbook()
'Activate Worksheet
Workbooks("MyWorkbook.xls").Sheets("Change to this worksheet!").Activate
End Sub
Many thanks in advance.
Also the title might not be best suited for this request, If you can suggest something else it may help
somebody looking for something similar find it easier