hgfantomas
New Member
- Joined
- Jul 2, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
So, I have two rows where I enter a date (row 9 and row 12 - for columns B thru L). I have a VBA macro that compares it to the date in corresponding column in row 5. If row 5 is older than input date, then the message box pops up. I am able to do this for row 9 but cannot seem to add the trigger for row 12. Any help? See below for my code so far.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r2 As Range, s2 As String
If Intersect(Target, Range("B5:L9"), Range("B5:L12")) Is Nothing Then Exit Sub
For Each r2 In Target.Rows
If Intersect(Range("B5:L5"), r2.EntireColumn).Value < Intersect(Range("B9:L9"), r2.EntireColumn).Value And Intersect(Range("B9:L9"), r2.EntireColumn) <> vbNullString Then s2 = s2 & ", " & r2.Address
Next r2
If s2 <> vbNullString Then MsgBox "Entry Date Past Due; Comment Required", vbOKOnly + vbExclamation
End Sub