I am trying to make a message box pop up when a value is entered in a cell range and have the message show the value in a corresponding cell range.
I've got Flight numbers in column $B7 and Departure times in column $J7.
When a departure time is entered I want a message box to pop up with a message that the corresponding flight has departed.
For example, if the Departure time is entered in J13, I want the message to include the Flight number in B13.
This is what I have:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xCell As Range, Rg As Range
On Error Resume Next
Set Rg = Application.Intersect(Target, Range("J7:J28"))
If Not Rg Is Nothing Then
For Each xCell In Rg
If xCell.Value > 0.01 Then
MsgBox "Aircraft Departed " & Range("B7:28"), vbInformation, "DEPARTURE"
Exit Sub
End If
Next
End If
End Sub
I know the error is in & Range("B7:28").
Thank You!
edit: formatting
Bookmarks