genracela
07-22-2010, 10:44 PM
I created an Active X button code that when you click it it will automatically save the file then go to another cell.
Here's a code that I did:
Private Sub CommandButton4_Click()
MsgBox ("PLEASE WAIT WHILE YOUR REQUEST IS BEING SAVED")
ThisWorkbook.Save
Range("A2").Select
End Sub
But I'm trying to create a Yes or No option instead of this, that if you click the active x button a msgbox will promp you if you want to save your file or no. Unfortunately I'm not able to write a perfect code.
I just want a msgbox that will promp:
msgbox = Do you want to save your updates?
Yes or No
If yes
Thisworkbook.save
range("A2").Select
if no
range("A2").select
msgbox = Are You Sure? Your updates will be lost if you won't save this file?
Yes or No
If yes
Thisworkbook.save
range("A2").Select
if no
range("A2").select
Thanks!
Here's a code that I did:
Private Sub CommandButton4_Click()
MsgBox ("PLEASE WAIT WHILE YOUR REQUEST IS BEING SAVED")
ThisWorkbook.Save
Range("A2").Select
End Sub
But I'm trying to create a Yes or No option instead of this, that if you click the active x button a msgbox will promp you if you want to save your file or no. Unfortunately I'm not able to write a perfect code.
I just want a msgbox that will promp:
msgbox = Do you want to save your updates?
Yes or No
If yes
Thisworkbook.save
range("A2").Select
if no
range("A2").select
msgbox = Are You Sure? Your updates will be lost if you won't save this file?
Yes or No
If yes
Thisworkbook.save
range("A2").Select
if no
range("A2").select
Thanks!