VBA Send Email based off cell value

nivster

New Member
Joined
Aug 10, 2021
Messages
7
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi everyone!

I am not familiar with VBA at all, so I'll appreciate all responses :)

I am trying to send an email address based off the cell value in my excel sheet. The body of the email will change depending on what the value is. If the value is under $0, the body of the email will be different than if it is over $0.

I tried looking for if then examples, and see if those would work but I'm not sure if this is the best solution.

I'd appreciate any information or steps that would help me get this :)
 
HI There,

I am also a novice with VBA. I'm working with an existing script, and have to have a check in place to stop an email from sending if all the criteria isn't met. It all works for the simplistic stuff. And I am sure that the solution to this is as simple as can be, but my brain just doesn't think this way. Below is the code that's tripping me up. Basically what I need the 'if' to do, is check the value in cell A9 is equal or greater than 1 but less than 7 and exit the sub. If the cell is empty "" or '0' to allow the script to run or resume next. Is there a way to do this? Or am I dreaming?

Any assistance would be greatly appreciated. :)

ElseIf Sheets("Amendment").Range("A9") >= 1 < 7 Then
MsgBox ("Please complete LINE 9 in full before proceeding.")
Exit Sub
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If Sheets("Amendment").Range("A9") >= 1 AND Sheets("Amendment").Range("A9") < 7 then ...
 
Upvote 0
OMG, was it really that easy? :cautious::censored: Thank you Michael! very much appreciated.
 
Upvote 0

Forum statistics

Threads
1,215,517
Messages
6,125,287
Members
449,218
Latest member
Excel Master

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