Forum

Send Email automati...
 
Notifications
Clear all

Send Email automatically from Excel based on cell colour

8 Posts
2 Users
0 Reactions
472 Views
(@kartikkd23)
Posts: 7
Active Member
Topic starter
 

Hi,

 

I require to send emails from Excel when the colour is red on the last column in the screenshot "Expiry date".

I want the email to be sent automatically to "Tech" which is column 3 in the screenshot if they have a red expiry date.

Any chance this is possible?

 
Posted : 29/01/2020 6:28 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi,

I'd usually look to do something like this using a Worksheet_Change event but unfortunately changing the colour of a cell does not trigger a change event in Excel. So you'd need to make some other change to the sheet/cell to trigger the VBA.

Once this is done you could then modify the code here to send the email.

In the Tech column is just the letter A, not an email address?

Regards

Phil

 
Posted : 29/01/2020 7:33 pm
(@kartikkd23)
Posts: 7
Active Member
Topic starter
 

Hi,

 

It should be a email address but for the sake of an example, i just used A.

 

How about using a change in text to trigger event change?

 

Im not too good at vba so not sure how i would write it.

 
Posted : 29/01/2020 7:37 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hiya,

Yes, changing a cell value would trigger an event that would then run the VBA to send the email.

In order to do this I'd need to know what cell(s) would change and what value in the cell indicates that an email should be sent?

What will the contents of the email be?

Regards

Phil

 
Posted : 29/01/2020 8:27 pm
(@kartikkd23)
Posts: 7
Active Member
Topic starter
 

The cells changed would be the column Q, the value in the cell i guess should be "expired".

 
Posted : 29/01/2020 9:26 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

OK so Q currently contains a date - you'll change this so it contains "expired" or some other text?

What will the contents of the email be?

 
Posted : 29/01/2020 11:16 pm
(@kartikkd23)
Posts: 7
Active Member
Topic starter
 

Yep expired, for now the contents can just say "test" i guess.

 
Posted : 30/01/2020 7:00 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi,

Please see attached.

The code for generating he email is taken from this post : VBA to create email and send with Outlook

Regards

Phil

 
Posted : 30/01/2020 11:51 pm
Share: