Greetings everyone,
I am trying to display a message box when a workbook opens if column B contains the word "term". With the use of the below code; however, I am getting a Run-time error '1004' Method 'Range' of object' 'Global' failed. I would appreciate if someone can tell me what I am doing wrong.
Private Sub Workbook_Open()
Dim rng As Range
Set rng = Range("B2:B")
If Not Intersect(Target, rng) Is Nothing Then
If rng = "term" Then
MsgBox "There are some terminated employees. Please update your file." & _
rng.Address & " = term"
End If
End If
Set rng = Nothing
End Sub
Bookmarks