R
Rebecca Ellis
Hi, I am trying to make a field in a sheet mandatory so that when th
user clicks a button I have added to take them to another sheet they ar
prompted that they must fill in a particular cell.
I have used the following code before to make a field compulsary befor
the user closes the whole file but I don't know how to adapt it to wor
when they leave the sheet:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim checkRng As Range
Set checkRng = Sheets("Sheet1").Range("A1")
If checkRng.Value = "" Then
Cancel = True
MsgBox "Please fill in " & _
checkRng.Address(False, False) & "."
End If
End Sub
Any help would be very much appreciated, thank
user clicks a button I have added to take them to another sheet they ar
prompted that they must fill in a particular cell.
I have used the following code before to make a field compulsary befor
the user closes the whole file but I don't know how to adapt it to wor
when they leave the sheet:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim checkRng As Range
Set checkRng = Sheets("Sheet1").Range("A1")
If checkRng.Value = "" Then
Cancel = True
MsgBox "Please fill in " & _
checkRng.Address(False, False) & "."
End If
End Sub
Any help would be very much appreciated, thank