I am struggling to find the correct bit of code to pop up a message box in Excel based upon a date table. My Workbook contains a front page where the user selects a free to choose date range, and I need my workbook to pop up a message if any of the dates correspond to a date in my date table (I attached some screenshots to create a clear picture.
the task of creating a pop up box etc.. I am perfectly comfortable with, however I cannot really find a way to only show a message box if any of the dates between the selected dates have a event logged.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Application.EnableEvents = True
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("D6")
If Not Application.Intersect(KeyCells, Target.Range("A1:G25")) _
Is Nothing Then
Call EventFinder
End If
End Sub
Result