Hello Excel gurus,
I have a lookup sheet with a particular value that is populated from a database via MS Query. This value is used by a display sheet. Works fine, but if the value is empty, I would like to be able to alert the user with a msgbox, then return false. I've been looking at a few things out there, here is one I found and tried to make work, but can't quite get it:
Public gOldN1 As Variant
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("N1")) Is Nothing Then
MsgBox "A Billing Contact is Required
End If
End If
End Sub
When the workbook starts:
Private Sub Workbook_Open()
gOldN1 = Sheets("Sheet2").Range("N1").Value
End Sub
Am I on the right track, or is there an easier way to do what I'm trying to do? I also want to return false and not let the sheet load.
Thanks in advance,
Jean Luc
I have a lookup sheet with a particular value that is populated from a database via MS Query. This value is used by a display sheet. Works fine, but if the value is empty, I would like to be able to alert the user with a msgbox, then return false. I've been looking at a few things out there, here is one I found and tried to make work, but can't quite get it:
Public gOldN1 As Variant
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("N1")) Is Nothing Then
MsgBox "A Billing Contact is Required
End If
End If
End Sub
When the workbook starts:
Private Sub Workbook_Open()
gOldN1 = Sheets("Sheet2").Range("N1").Value
End Sub
Am I on the right track, or is there an easier way to do what I'm trying to do? I also want to return false and not let the sheet load.
Thanks in advance,
Jean Luc