+ Reply to Thread
Results 1 to 11 of 11

Sending email whenever a cell is changed is MS Excel 2010

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    Quatre Bornes - Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    10

    Sending email whenever a cell is changed is MS Excel 2010

    Hi Everybody,

    I've just started to learn about VBA and still struggling to find my way out.
    I would like to know if there is a way to send an email whenever the value of a cell or range of cells is changed in MS Excel 2010.
    I currently have an excel workbook (please see attached) with dates in different rows.
    There are a certain amount of information there in other cells relative to a planning.

    Say when cell Z5 is changed to 2 and a 'Y' is placed in cell C5 then an email is opened, containing the information as below:

    sample email.jpg

    The same thing must happen whenever any cell under the dates are changed to another value
    In sheet 2 of the workbook, I've defined a value corresponding to each one of the letters and number found in sheet 1.

    Maybe my approach is wrong, any feedback and comments are most welcome.

    Thank you beforehand for your advise and help.

    Kind regards,

    Shameem
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Use this to create a new email

    Right click Sheet1 tab at the bottom and hit view code

    Please Login or Register  to view this content.
    Then in a new Module put the following code

    Please Login or Register  to view this content.
    Last edited by GaidenFocus; 07-25-2013 at 02:26 PM.

  3. #3
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Sending email whenever a cell is changed is MS Excel 2010

    In the body you can put in the message you want. To put the next set of text on a new line use vbNewLine

    example:
    Please Login or Register  to view this content.
    would come out to:

    Hey, I am sending an E-Mail.
    So read it.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending email whenever a cell is changed is MS Excel 2010

    I think they would like to send dates from the calendar set up on his spreadsheet.

    Also, whenever C5 is changed to yes, the other ranges don't have to be "2". They will differ and change the body of the email.

    I don't see an attachment in your picture of the email. Are you wanting to attach them spreadsheet to the email?

    Would it be okay to use a dropdown validation menu in column C instead of typing Y? It may reduce the number of emails sent accidentally.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Will all calendars be set up with 2 months stacked on top of each other?

  6. #6
    Registered User
    Join Date
    06-10-2013
    Location
    Quatre Bornes - Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Thanks for your feedback and comments GaidenFocus.
    I shall try and revert.

    Cheers

    Shameem

  7. #7
    Registered User
    Join Date
    06-10-2013
    Location
    Quatre Bornes - Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Hi XeRo Solus,

    Thanks a lot for your post.
    I'm attaching the picture here.
    sample email.jpg
    Actually you are right about having a dropdown validation menu.
    I shall try this one too.

    Thanks a lot

    Cheers

    Shameem

  8. #8
    Registered User
    Join Date
    06-10-2013
    Location
    Quatre Bornes - Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Hello XeRo Solus,

    You are right about the calendar.
    I will actually have all the months of the year in the worksheet but i'm not sending the whole worksheet by email, only the value found in the cell whenever same is changed.

    Thanks

    Shameem
    Last edited by shaeto; 07-25-2013 at 02:51 PM.

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending email whenever a cell is changed is MS Excel 2010

    The only problem I foresee, if you use validation list comboboxes in column C, it will not trigger the worksheet_change event to fire the macro. You would have to use a button or someone other method.

    I'm not sure this is a setback though. Sending emails based on a worksheet change event has the potential to send a bunch of unnecessary emails.

  10. #10
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending email whenever a cell is changed is MS Excel 2010

    I was working on a solution to the body of your email but I haven't found a clear path. Since you're dates are a combination of two different cells with no way to reconcile what cell is changing with the month its changing in, its going to be difficult. To get all the information you'd like to into the email you might have to change the format of your calendar.

  11. #11
    Registered User
    Join Date
    06-10-2013
    Location
    Quatre Bornes - Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Sending email whenever a cell is changed is MS Excel 2010

    Thanks a lot XeRo Solus,
    I really appreciate your comments and feedback.
    I was thinking same thing about the calendar format too.
    I am giving it a thought and hope to come out wuth something.
    Please do let me know if you have any idea about what might be the best approach.

    Thanks again

    Cheers

    Shameem

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sending HTML email via excel VBA - arriving as RTF email
    By Shuter1 in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:35 AM
  2. [SOLVED] sending Email (via outlook) from Excel with cell range and image from external file
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-20-2012, 11:10 AM
  3. Replies: 2
    Last Post: 12-26-2011, 08:10 PM
  4. Sending an email via Excel to an address from a cell
    By Steven811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2010, 09:14 AM
  5. Sending an email from Excel to multiple email addresses
    By insanity66 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2009, 02:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1