VBA Code to Save and Send current workbook

A8L5S

New Member
Joined
Aug 28, 2014
Messages
28
Hi,

I’m trying to create a VBA code to Save the current work book and then send to a specific e-mail address. I’ve managed to get it to attach the file to an e-mail but can’t seem to get the other bits to work at all. Below is what I am trying to achieve.

if sheet 1 O5 or R5 or U5 = “Not Started/Required” then

End Sub

If sheet 1 O5 or R5 or U5 = “Started – Incomplete Fields” then popup box comes up asking: “Are you sure you want to send?”

If No then

- Firstly Check to see if O5 on sheet 1 = “Started – incomplete Fields” if it does then change text for N3:N82 on sheet 1 to red
- Then to check to see if R5 on sheet 1 = “Started – incomplete Fields” if it does then change text for N3:N65 on sheet 2 to red
- Then to check to see if u5 on sheet 1 = “Started – incomplete Fields” if it does then change text for N3:N69 on sheet 3 to red

End Sub

Other wise it asks the user to save the file, file name is filled in using D2 on sheet 1. If the user changes this then D2 will need replacing with what it has been changed to

Then to e-mail the excel sheet to form@gmail.com using subject as Q2 on sheet 1 and body of e-mail with “Please find attached form”

Any Help would be much appreciated.

Regards

Aaron
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,376
Messages
6,124,593
Members
449,174
Latest member
chandan4057

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