I have a workbook and have et up a macro to send a reminder to outlook, but get a run time error "type mismatch
The code below is highlighted
See sample data and code below
It would be appreciated if someone could kindly amend my code
The code below is highlighted
Code:
.Start = DateValue(Range("D" & ctr)) + TimeValue(Range("D" & ctr))
See sample data and code below
It would be appreciated if someone could kindly amend my code
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
2 | No. | Branch | Chassis | Reminder Due Date-10 | Due Date | Due Date Time | Duration | Subject | Time | ||
3 | 1 | Br1 | AFD95075 | 18/02/2018 08:00 | 28/02/2018 00:00 | 28/02/2018 08:00 | 30 | AFD95075 is due on 28/02/2018 | 08:00 | ||
4 | 2 | 30 | 08:00 | ||||||||
5 | 3 | 30 | 08:00 | ||||||||
6 | 4 | 30 | 08:00 | ||||||||
Settlement Reminders |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B3 | =IF(Settle!L2="","",Settle!L2) |
Code:
Sub Reminders()
Dim startRow As Long, endRow As Long, ctr As Long
startRow = 3
endRow = Cells(Rows.Count, 1).End(xlUp).Row
For ctr = startRow To endRow
With CreateObject("Outlook.application").CreateItem(1)
.Start = DateValue(Range("D" & ctr)) + TimeValue(Range("D" & ctr))
.Duration = CLng(Range("G" & ctr)) ' 30
.Subject = CStr(Range("H" & ctr)) ' subject text
.ReminderSet = True
.Save
End With
Next
End Sub
Last edited: