LadyDisdain
New Member
- Joined
- Apr 9, 2017
- Messages
- 7
I apologise for the vague title - couldn't think of how to phrase this.
I'm creating a system to send email reminders for equipment that needs calibrating. I have a series of IF statements to check the status and due dates for each piece of equipment, and also look at another sheet that is a log of when emails have been sent.
There is more than one scenario where an email would be triggered:
If equipment is available and due date is less than or equal to today AND the equipment ID is not in the Email Log, then send email.
If equipment is available and due date is less than or equal to today AND the equipment ID exists in the Email Log AND the due date logged doesn't equal the current due date, send email.
I don't want to write out the whole code for the email twice, so I tried calling another module but then I have a problem with "EquipID" etc not showing.
Any ideas? I'm very new to this whole VBA thing.
I'm creating a system to send email reminders for equipment that needs calibrating. I have a series of IF statements to check the status and due dates for each piece of equipment, and also look at another sheet that is a log of when emails have been sent.
There is more than one scenario where an email would be triggered:
If equipment is available and due date is less than or equal to today AND the equipment ID is not in the Email Log, then send email.
If equipment is available and due date is less than or equal to today AND the equipment ID exists in the Email Log AND the due date logged doesn't equal the current due date, send email.
I don't want to write out the whole code for the email twice, so I tried calling another module but then I have a problem with "EquipID" etc not showing.
HTML:
lLastRow = Cells(Rows.Count, 1).End(xlUp).Row
For lRow = 2 To lLastRow
Avail = Cells(lRow, (CNBH("Available")))
EquipID = Cells(lRow, (CNBH("Equipment ID")))
EquipName = Cells(lRow, (CNBH("Equipment Name")))
CalDue = Cells(lRow, (CNBH("Calibration Next Due")))
CalRem = Cells(lRow, (CNBH("Calibration Reminder Date")))
CalFreq = Cells(lRow, (CNBH("Calibration Frequency")))
Class = Cells(lRow, (CNBH("Classification")))
CalCont = Cells(lRow, (CNBH("Calibration Contact")))
CalDet = Cells(lRow, (CNBH("Calibration Details")))
AccCrit = Cells(lRow, (CNBH("Acceptance Criteria")))
RemDay = Cells(lRow, (CNBH("Rem Day")))
If Avail = False Or Avail = "" Then
MsgBox EquipID & " is unavailable"
Any ideas? I'm very new to this whole VBA thing.