Hi! Apologies if this has been posted elsewhere, I just can't seem to find anything that suits my purpose.
What I need to do, is check that a range of cells have a value entered before they can move off the sheet, using the button (I realise they can just move between sheets using the tabs). I've come up with this and it works, but when testing it and going back and removing the values, it won't activate the msgbox. What am I doing wrong?
Sub Mandatory1()
With Sheets("FORM_SCHEDNEWHIRE")
If IsEmpty(.Range("F5,F7,F9,F11,F13,F15,F17,F19,F21,F23,F25,F27,F31,F33,F35,F37")) Then
MsgBox "Please ensure you have answered all of the questions before moving on.", vbCritical
Application.Goto .Range("F5,F7,F9,F11,F13,F15,F17,F19,F21,F23,F25,F27,F31,F33,F35,F37")
Else
Sheets("FORM_BANK_SUPER").Select
Range("F6:I6").Activate
End If
End With
End Sub
Thanks in advance.
What I need to do, is check that a range of cells have a value entered before they can move off the sheet, using the button (I realise they can just move between sheets using the tabs). I've come up with this and it works, but when testing it and going back and removing the values, it won't activate the msgbox. What am I doing wrong?
Sub Mandatory1()
With Sheets("FORM_SCHEDNEWHIRE")
If IsEmpty(.Range("F5,F7,F9,F11,F13,F15,F17,F19,F21,F23,F25,F27,F31,F33,F35,F37")) Then
MsgBox "Please ensure you have answered all of the questions before moving on.", vbCritical
Application.Goto .Range("F5,F7,F9,F11,F13,F15,F17,F19,F21,F23,F25,F27,F31,F33,F35,F37")
Else
Sheets("FORM_BANK_SUPER").Select
Range("F6:I6").Activate
End If
End With
End Sub
Thanks in advance.