I'm trying to use an Ok/Cancel Message box to run a macro, however, it's just not working
If I use the below code regardless of if Ok or Cancel is pushed the macro will run
However, if I use the below regardless of if Ok or Cancel is pushed the macro doesn't run at all
Can someone please advise me what I'm doing wrong here?
Thanks in advance
If I use the below code regardless of if Ok or Cancel is pushed the macro will run
Code:
Sub Button()'
' Button Macro
'
Dim Answer As String
MsgBox "WARNING: The following process will clear all of today's submitted trades! Do you wish to proceed?", vbOKCancel + vbQuestion
Run "EODBACKUP"
End Sub
However, if I use the below regardless of if Ok or Cancel is pushed the macro doesn't run at all
Code:
Sub Button()'
' Button Macro
'
Dim Answer As String
MsgBox "WARNING: The following process will clear all of today's submitted trades! Do you wish to proceed?", vbOKCancel + vbQuestion
If ans = vbOK Then
Run "EODBACKUP"
End If
End Sub
Can someone please advise me what I'm doing wrong here?
Thanks in advance