redridinghood74
New Member
- Joined
- Jul 28, 2017
- Messages
- 14
Some code;
(AlertDate) (dateRange)
03/11/17 != 03/11/17
Vba form uses EVALUATE to build dateRange values from comboboxes.
Matching date doesn't match, scratching head alot
Code:
Private Sub DateReminder()
Dim LastRow As Long
Dim yesterdaysDate As Date
Dim AlertDate As Date
Dim dateRange As Range
Dim foundDate As Range
Dim firstName As String
Dim lastName As String
Dim phoneNumber As String
Dim eMail As String
AlertDate = DateSerial(Year(Date), Month(Date), Day(Date - 2))
LastRow = Worksheets("BOOKINGS").Cells(Rows.Count, 1).End(xlUp).Row
Set dateRange = Worksheets("BOOKINGS").Range("H2:H" & LastRow)
For Each foundDate In dateRange
If DateValue(foundDate.Value) = DateValue(AlertDate) Then
firstName = foundDate.offset(0, 2).Value
lastName = foundDate.offset(0, 3).Value
phoneNumber = foundDate.offset(0, 5).Value
eMail = foundDate.offset(0, 6).Value
MsgBox &firstName & vbNewLine &lastName & vbNewLine &phoneNumber & vbNewLine &eMail
End If
Next foundDate
End Sub
(AlertDate) (dateRange)
03/11/17 != 03/11/17
Vba form uses EVALUATE to build dateRange values from comboboxes.
Matching date doesn't match, scratching head alot