![]() |
#1
|
|||
|
|||
![]()
I have inserted a macro into a spreadsheet to read through a list of vehicles and their tax expiry dates and send me an email to notify me when one is due within 28 days. However I need to put something extra in so the formula does not resend cells that have already been notified, the coding I have I am pasting below, can anyone please help?
Sub Fuels() Worksheets("FUEL CARDS").Activate For xRow = 6 To ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row expiry_Date = Cells(xRow, 3).Value If ((expiry_Date - 28 <= Date) And (Len(Cells(xRow, 4).Value < 4))) Then Cells(xRow, 4).Value = Date strVehicles = strVehicles & Cells(xRow, 1).Value & ", " End If Next strEmailAddress = "StephenODonnell@tfl.gov.uk" strSubject = "Vehicle Fuel Cards expiring soon" email_body = "Hi all," & vbNewLine & vbNewLine & "the following vehicles Fuel Cards expires within next 28 days." & vbNewLine & vbNewLine & _ strVehicles Call SendeMail(strEmailAddress, "", "", strSubject, email_body) End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Excel | Excel | 1 | 08-14-2014 05:11 PM |
![]() |
withersd46260 | Excel | 2 | 04-30-2014 08:33 AM |
Formula | muhu | Excel | 1 | 04-14-2014 08:19 AM |
![]() |
TotalONE | Excel | 3 | 11-26-2013 01:30 PM |
![]() |
Corca | Excel | 6 | 02-22-2010 09:40 PM |