Generate Automatic Email based on Date in Excel doc

suet

Board Regular
Joined
Oct 19, 2005
Messages
56
Hi

I have an excel document that contains Defects Date.

I need to generate an email that will look at the Defects Date and email me 4 months before that Defects Date is dude.

Could someone please advise how I would go about coding this into the workbook.

I would really appreciate any advise/guidance on VBA code that needs to be used.

Kind Regards
Sue
 

Attachments

  • Defects Date Email Generate.PNG
    Defects Date Email Generate.PNG
    253.3 KB · Views: 21
Hi Gordsky

The code is working in that it generates the email but it copies everything from the spreadsheet into the email. It doesn't appear to filter just the records for Defects Date which are 4 months away.

It literally copies all the data into the email.

View attachment 60227

Anything else I can try?

Regards
Sue
It worked when I tested it, Is your info in a table? (rather than cells of the worksheet)? Does the filter range in the code match the date range?
Can you attach a sample of your worksheet
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi Gordsky

The code is working in that it generates the email but it copies everything from the spreadsheet into the email. It doesn't appear to filter just the records for Defects Date which are 4 months away.

It literally copies all the data into the email.

View attachment 60227

Anything else I can try?

Regards
Sue
Morning Gordsky

Thank you very much for your help.

Have a fab day.

Take care and regards
Sue
 
Upvote 0
is it working now?
Hey

Not as needed as I just need to get the records that are due in 4 months and not the whole worksheet.

But thank you as you have helped a lot with the core coding.

Thank you.

Regards
Sue
 
Upvote 0
Hey

Not as needed as I just need to get the records that are due in 4 months and not the whole worksheet.

But thank you as you have helped a lot with the core coding.

Thank you.

Regards
Sue
as i said, the code worked for me in the way you requested when tested so check the dates are actually dates and that they are in the column referred to in the filter within the code.
 
Upvote 0
as i said, the code worked for me in the way you requested when tested so check the dates are actually dates and that they are in the column referred to in the filter within the code.
Hi Gordsky

I will edit the dates and try running the code again.

Is there anyway I can email you the actual spreadsheet?

Regards
Sue
 
Upvote 0
Hi Gordsky

I will edit the dates and try running the code again.

Is there anyway I can email you the actual spreadsheet?

Regards
Sue
no but you can attach it here using the XL2BB which is the sites method of posting sheets. here
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top