Automatically send email based on cell value

hockeyfan123

New Member
Joined
Feb 11, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I am fairly good with Excel formulas but a complete novice in Macros. I am looking to automatically send an e-mail to a specific person when the value of a cell (A2) changes without any human intervention to push a button. The person's email is located in cell B2 and my email is located in cell C2. The text of the email is simply: "There has been a change in the value of cell A2 and the new value is:

There are Excel Macros I have seen that will pop-up an e-mail when a cell value changes but, the person has to be there to push the send button for it to complete. In this case, there may not be anyone present at the PC to push a send button so, the entire process must be automated.

Thank you for any help you can provide!!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
PS. I found something similar from mrmmickle1 from 7 years ago but, it is different enough that it does not appear to work for this purpose.

Again, any help would be greatly appreciated!
 
Upvote 0
How does the cell change if there is no human intervention ?
 
Upvote 0
How does the cell change if there is no human intervention ?
Hi Michael,

We are continuously gathering data from devices on our network using Excel's Web Query feature to gather HTML files from a statistics server. There are numerous pivot tables and calculations involved with respect to this data on numerous tabs but, because this data is confidential, I cannot share the actual spreadsheet.

There is a summary Tab in Excel that posts the key data gathered from the tabs into a handful of cells. These cells in the summary tab change each minute when the Excel Spreadsheet automatically gathers the latest data from via a web query in HTML and cell A2 is a key one that we watch for changes.
 
Upvote 0
Sorry I don't deal with web queries, never hadn anything to do with them.
However, have a look at this thread on another forum, that should point you in the right direction.
 
Upvote 0
Hi Michael - This is very helpful and I appreciate it very much. That gives me a good starting point and let me see if I can wrap-that into some other examples of email generation code.

Thanks again!
 
Upvote 0
So I now understand that this will require VBA. Per your suggestion, in order for VBA to recognize a web query, I will have to create a new class for VBA in addition to the normal one. The site you pointed me to show that this can be created as follows:

New VBA Class Code
Public WithEvents qt As QueryTable


Private Sub qt_AfterRefresh(ByVal Success As Boolean)
MsgBox ("I just refreshed")
End Sub


Then in a normal module put
Normal VBA Module Code


Dim MyQuery As New Class1
Sub Initialize_It()
Set MyQuery.qt = ThisWorkbook.Worksheets("Sheet1").QueryTables(1)
End Sub

If anyone can help from here in VBA - which I have not worked with in many years, to answer the initial question about automatically generating an e-mail with no human intervention, I would very much appreciate it.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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