+ Reply to Thread
Results 1 to 15 of 15

Macro creating an Email

  1. #1
    Registered User
    Join Date
    03-19-2007
    Posts
    35

    Macro creating an Email

    I am new to using Macros and am not sure how to go about this.

    I have a workbook with 20 worksheets. I would like to create a Macro on each sheet that when you click a button it creates an email to a list of recipeients for each sheet.

    HELP!

    thanks,

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gambinus,

    Do you have a sample sheet you can post, or explain how the information is arranged on the worksheets?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-19-2007
    Posts
    35
    I would like to send each individual worksheet as an attachment to a list of recipients.


    Example:

    Worksheet A, B, C


    Send worksheet A to Larry and Bob
    Send worksheet B to Mary
    Send worksheet C to Biff

    So on each individual worksheet, I would like a button, so when I click on the button on Worksheet A and email opens with the Worksheet A as an attachment, with Larry and Bob in the sender/To field

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gambinus,

    Sorry, I should have asked this in the last post. Are the recipients email addresses in column "A" or just their names? If you are using just the names are you sending the emails via Outlook? I am asking to determine whether the code needs to resolve the names using your address book.

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    03-19-2007
    Posts
    35
    Right now I dont have the names anywhere. Right now I just have the workbook and worksheets with the data. I can add the contact emails whereever.

    This email would be going out via Outlook

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gambinus,

    Sorry this took so long there has been a long going on that has prevented me finishing my code projects. This macro will need some tweaking to fit your needs, but the basics are all here.
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time.
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel.

    To Run the Macro...
    To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Sincerely,
    Leith Ross

  7. #7
    Registered User
    Join Date
    03-19-2007
    Posts
    35
    Thank you Leith Ross, that worked great. Is it possible to change the Macro so that instead of automaticaly sending the email it just brings one up?

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gambinus,

    To bring up the Outlook mail inspector is an easy change. You will need to edit the portion of the macro that sends the emaii. Here it is below with the change in red...
    Please Login or Register  to view this content.
    sincerely,
    Leith Ross

  9. #9
    Registered User
    Join Date
    03-19-2007
    Posts
    35
    Again, thank you, Leith Ross.

    One more fine tuneing. How can I set up the email to include recipients to be CC'ed?

    Thank you again.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gambinus,

    Where are the recipients names? Are these the individuals' email addresses or just their first and last names?

    Sincerely,
    Leith Ross

  11. #11
    Registered User
    Join Date
    03-19-2007
    Posts
    35
    It will be there email addresses. Currently They are not located anywhere. I can put them wherever.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Gamibinus,

    I have added the CC line to the email. This is a string value. Each email address is separated by a semicolon. The names can be hard coded if they aren't going to change frequently or loaded from a worksheet.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  13. #13
    Registered User
    Join Date
    10-10-2008
    Location
    Illinois
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    85
    I am trying to do something very similar only i am using Outlook Express and cannot seem to get it to work. I have replaced the ("Outlook.Application") with ("MSIMN.Application"). Any ideas what i could be doing wrong?

  14. #14
    Registered User
    Join Date
    10-30-2008
    Location
    Toronto
    Posts
    13
    Hey Lieth,

    Do you have a minute to help with a simular request, sending emial from excel file.

    cheers
    Rop1

  15. #15
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Khaos176 and ROP1,

    Please start a new thread to ask your question. Asking questions in another post can become confusing very quickly. I will be happy to answer your questions once you start a new thread.

    Sincerely,
    Leith Ross

+ 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. excel 2003: creating a standard email address from a list of names
    By mackinlay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2008, 09:37 AM
  2. Replies: 0
    Last Post: 07-07-2008, 12:03 PM
  3. way:Email Macro
    By Sharp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2008, 09:46 AM
  4. Send Macro via email??
    By Cin.NJ in forum Excel General
    Replies: 1
    Last Post: 06-03-2008, 12:48 PM
  5. Creating Input Box within a Macro
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2007, 09:05 AM

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