Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-18-2014, 05:12 AM
odonnest odonnest is offline Formula Help Windows XP Formula Help Office 2007
Novice
Formula Help
 
Join Date: Dec 2014
Posts: 4
odonnest is on a distinguished road
Default Formula Help

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Help Formula Excel Excel 1 08-14-2014 05:11 PM
Formula Help Formula Help withersd46260 Excel 2 04-30-2014 08:33 AM
Formula muhu Excel 1 04-14-2014 08:19 AM
Formula Help What formula should I use? TotalONE Excel 3 11-26-2013 01:30 PM
Formula Help Help with Formula Corca Excel 6 02-22-2010 09:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft