Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Send Email: Once priority is changed

How can I send an email if the value of a certain field changes to something.

For eg: If Priority field changes to 5 I want to send an email to myself.

I know how to get the email working on click of a button on the userform,
But dont know how to get it working once a field is updated.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,203
Default Send Email: Once priority is changed

Sam,
How does the 5 get into the priority field? Is it typed in by a user or
calculated by some formula in the cell(s). I also presume this could be in a
list in a particular column? What column?

I ask those questions because if the value is typed in by someone, then you
can use the Worksheet_Change() event to test for an entry of 5 in the
cell/column and send the email based on that. But if it's controlled by a
formula, then things get more difficult in an unattended workbook.

"sam" wrote:

How can I send an email if the value of a certain field changes to something.

For eg: If Priority field changes to 5 I want to send an email to myself.

I know how to get the email working on click of a button on the userform,
But dont know how to get it working once a field is updated.

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,203
Default Send Email: Once priority is changed

Sam,
I re-read your post and I'm wondering if you actually want to send the email
based on a change of a field in your UserForm. This should help with that.
There are 2 events that would be useful for it: either the _Change() event
or the _Exit(). I'd suggest the _Exit() as then you can test for an entry of
5, whereas the _Change() would trigger if someone started typing a number
like 555-1212 just as soon as they typed the 1st '5'.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Text = "5" Then
MsgBox "You entered a 5"
... your code to send the email here.
End If
End Sub

or (not as good a choice)
Private Sub TextBox1_Change()
If TextBox1.Text = "5" Then
MsgBox "You entered a 5"
... your code to send the email here.
End If
End Sub




"sam" wrote:

How can I send an email if the value of a certain field changes to something.

For eg: If Priority field changes to 5 I want to send an email to myself.

I know how to get the email working on click of a button on the userform,
But dont know how to get it working once a field is updated.

Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send Email: Once priority is changed

Hi Sam, try
http://www.rondebruin.nl/mail/change.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"sam" wrote in message ...
How can I send an email if the value of a certain field changes to something.

For eg: If Priority field changes to 5 I want to send an email to myself.

I know how to get the email working on click of a button on the userform,
But dont know how to get it working once a field is updated.

Thanks in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA macro to send email attachment from default email client wifigoo Excel Programming 2 April 12th 08 03:54 PM
Send data from Excel in email from specific email address Erik Excel Programming 5 December 5th 07 05:09 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
send email with email addresses in a range of cells Craig[_24_] Excel Programming 1 October 10th 05 09:26 PM
body of email disappears when I send an email from Excel ~A Excel Discussion (Misc queries) 0 February 25th 05 10:55 PM


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"