+ Reply to Thread
Results 1 to 6 of 6

Send an Excel with Outlook using VBA and Select an email address from a cell

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    Utrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    6

    Send an Excel with Outlook using VBA and Select an email address from a cell

    I created a VBA which will send a sheet of a excelfile to a fixed email address in the VBA code. That is nice, but what I really want is the VBA to look at a particular cell in the activesheet (M2) to pick up the email address from there. Below is a part of the VBA code. In the section .To = "[email protected]" I want a code which will pick up the email address. Does anyone know which code I can use??

    Please Login or Register  to view this content.
    Last edited by TNT Innight; 02-19-2015 at 08:13 AM. Reason: I did not use the Code wrapping

  2. #2
    Registered User
    Join Date
    03-04-2015
    Location
    MT
    MS-Off Ver
    2013
    Posts
    9

    Re: Send an Excel with Outlook using VBA and Select an email address from a cell

    Try this. I use the code ActiveSheet.Range("B5") to reference a cell in my emails, that way I can change it. Let me know if it works for you.


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-24-2014
    Location
    Utrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Send an Excel with Outlook using VBA and Select an email address from a cell

    Yeah! Thanks, that was very helpfull.

  4. #4
    Registered User
    Join Date
    03-04-2015
    Location
    MT
    MS-Off Ver
    2013
    Posts
    9

    Re: Send an Excel with Outlook using VBA and Select an email address from a cell

    Just a heads up that will use M2 from whatever sheet you have open in excel. If you dont want to deal with that you can use this code:

    ActiveWorkbook.Sheets("Rent Tracker").Range("M2")

    This will make it so it will use M2 on the specified sheet mine is "Rent Tracker" Note that this is case sensitive. So your code will look like this: Just change the sheet name.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-24-2014
    Location
    Utrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Send an Excel with Outlook using VBA and Select an email address from a cell

    This is even better. I am beginning to understand VBA codes better now. Thank you

  6. #6
    Registered User
    Join Date
    03-04-2015
    Location
    MT
    MS-Off Ver
    2013
    Posts
    9

    Re: Send an Excel with Outlook using VBA and Select an email address from a cell

    Glad to help. Please edit your first post and ad the prescript of Solved on there.

+ 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. Replies: 0
    Last Post: 05-13-2014, 01:25 AM
  2. Send email to address based on cell value
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 03:06 PM
  3. Send email based on address in a cell
    By behnam in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2013, 02:53 PM
  4. Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell
    By paul_sykes00 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-17-2012, 12:54 AM
  5. [SOLVED] one pdf file send to 20,000 email address use vbs coding & through outlook 2003
    By sonu_kumar444 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 07-03-2012, 04:22 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