on ‎2016 Nov 16 2:16 PM
Hi,
I am trying to write a small piece of VBA to give a a yes / no answer.
So if the user has selected the correct month save the data. If the user has no selected the correct month either do nothing or refresh sheet.
This is the code that i have written.
Function BEFORE_SAVE()
MsgBox "ARE YOU SAVING TO THE CORRECT MONTH", vbYesNo
If answer = vbYes Then
EAA.SaveAndRefreshWorksheetData
End If
If answer = vbNo Then
EAA.RefreshActiveSheet
End If
End Function
Request clarification before answering.
If MsgBox("ARE YOU SAVING TO THE CORRECT MONTH", vbYesNo) = vbYes Then
EAA.SaveAndRefreshWorksheetData
Else
EAA.RefreshActiveSheet
End IfYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 32 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.