Skip to Content
0
Former Member
Nov 16, 2016 at 02:16 PM

YES no boxes using vba

88 Views Last edit Sep 18, 2017 at 09:15 PM 2 rev

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