abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,483
- Office Version
- 2019
- 2010
- Platform
- Windows
hi
I create code to show message based on condition . my formula is based on msgbox =IF(F5<0,MSG(),"")
so what I want if I press cancel or close button when show the message box based on formula is existed in some cells ,then should the message should close
I create code to show message based on condition . my formula is based on msgbox =IF(F5<0,MSG(),"")
VBA Code:
Private Sub MSG()
Dim Action As VbMsgBoxResult
Action = MsgBox("the date has been expired ", vbOKCancel + vbExclamation + vbDefaultButton2, "warning!")
If Action = vbOK Then
End If
If Action = vbCancel Then Exit Sub
End Sub