Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send e-mail alert based on Excel cell value? 2

Status
Not open for further replies.

meghan95

Technical User
Sep 18, 2002
18
0
0
US
Does anyone know if it's possible to send an e-mail alert when a number on an Excel spreadsheet reaches a certain amount? It would be used in the following type of example: the bookkeeper keeps track of daily cash balances. If the balance in a cell is less than 100,000, I would want an e-mail to let me know.

I'm not very familiar with Visual Basic, but I'm sure there's some sort of solution.

Thanks, Meghan
 
You can get Excel to email you with this:

Sub auto_open()
If Range("c6") > 1000 Then
Sheets("Sheet1").Select
ActiveWorkbook.SendMail Recipients:="recipient@server.com", Subject:="Whatever you want the subject line to say"
End If
End Sub

It wil run automatically when the file is opened. If you don't want it to run then, you should name it something other than auto_open, but then it will have to be run before exiting to email you. You could create a button that would run it and then save and close the file.

Sawedoff

 
Awesome-star for you! Thank you so much - I'm really going to win some points with my boss for this one. I'm assuming if I want the e-mail to be sent when the worksheet is closed, I can just change auto_open to auto_close.

 
That should do it. Glad it helped. Thanks for the shiny thing.

Sawedoff

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top