Chewyhairball
Active Member
- Joined
- Nov 30, 2017
- Messages
- 312
- Office Version
- 365
- Platform
- Windows
Hi Folks
I have the following code that basically does not allow someone to leave the sheet they are on unless all required field are complete. It works perfect for my needs
My question is is it possible to have more than one worksheet_deactivate say for Range A2 with a different message. These would be two seperate critera and not and/or statments.
thanks
Rory
Private Sub Worksheet_deactivate()
Set target = Range("A1")
If target.Value > "0" Then
MsgBox "You must click the Inform AWO button above before you can save and leave this sheet", , "Input Required"
Sheet2.Activate
End If
End Sub
I have the following code that basically does not allow someone to leave the sheet they are on unless all required field are complete. It works perfect for my needs
My question is is it possible to have more than one worksheet_deactivate say for Range A2 with a different message. These would be two seperate critera and not and/or statments.
thanks
Rory
Private Sub Worksheet_deactivate()
Set target = Range("A1")
If target.Value > "0" Then
MsgBox "You must click the Inform AWO button above before you can save and leave this sheet", , "Input Required"
Sheet2.Activate
End If
End Sub