Hi all,
Just another quick question regarding some macro code I have.
I have 2 buttons, each with their own macro.
Button/Macro 1 is:
Public Sub SaveAsC6()
ThisFile = Range("C6").Value
ThisFile2 = Range("E5").Value
ActiveWorkbook.SaveAs Filename:=ThisFile & "-" & ThisFile2 & "-" & Format(Date, "yyyymmdd")
End Sub
When clicking this Macro, it saves the file, using the data in cells C6, E5 and today's date as the filename.
What I would like to do is add a message box that comes up to confirm to me that the save has been successful after the button has been pressed/saved. Can anyone tell what code I need to add?
The message box can say something along the lines of 'Save Successful'.
Button/Macro 2 is:
Sub CloseWorkbook()
ThisWorkbook.Close Saved = True
End Sub
Upon pressing this button, Excel closes the workbook. However, before closing it, I would like a message box coming up, asking me 'Are you sure you want to exit'?
Thanks!
Just another quick question regarding some macro code I have.
I have 2 buttons, each with their own macro.
Button/Macro 1 is:
Public Sub SaveAsC6()
ThisFile = Range("C6").Value
ThisFile2 = Range("E5").Value
ActiveWorkbook.SaveAs Filename:=ThisFile & "-" & ThisFile2 & "-" & Format(Date, "yyyymmdd")
End Sub
When clicking this Macro, it saves the file, using the data in cells C6, E5 and today's date as the filename.
What I would like to do is add a message box that comes up to confirm to me that the save has been successful after the button has been pressed/saved. Can anyone tell what code I need to add?
The message box can say something along the lines of 'Save Successful'.
Button/Macro 2 is:
Sub CloseWorkbook()
ThisWorkbook.Close Saved = True
End Sub
Upon pressing this button, Excel closes the workbook. However, before closing it, I would like a message box coming up, asking me 'Are you sure you want to exit'?
Thanks!