+ Reply to Thread
Results 1 to 4 of 4

Adjust email macro to send only select files in a folder rather than all ref'ed in a range

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Adjust email macro to send only select files in a folder rather than all ref'ed in a range

    Hi everyone,

    I have the following code I use to email attachments from a folder location to multiple recipients listed on an excel worksheet:

    Please Login or Register  to view this content.
    Right now, the code reads the email addresses and uses the folder link text in columns F and G to file files to email. Each row in columns F and G correspond to an email recipient in the same rows in column D.

    What I'd like to do is amend the code so that only cells selected in column B will result in the files location text found in columns F and G to be sent. So for example, if I select cells B2, B4 and B24, only the file location text found cells F2, F4, and F24 will be used to find the attachments and send the emails. Any other file locations in columns F and G that are not in those three rows will be ignored.

    Any ideas?

    Thanks!!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adjust email macro to send only select files in a folder rather than all ref'ed in a r

    Quote Originally Posted by Groovicles View Post
    What I'd like to do is amend the code so that only cells selected in column B will result in the files location text found in columns F and G to be sent. So for example, if I select cells B2, B4 and B24, only the file location text found cells F2, F4, and F24 will be used to find the attachments and send the emails. Any other file locations in columns F and G that are not in those three rows will be ignored.
    You still want to email every row but only want to include the attachments for the selected rows in column B; is that correct? If Yes, try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Adjust email macro to send only select files in a folder rather than all ref'ed in a r

    Hey Alpha,

    I'm trying to email only those attachments that I've selected in column B. So right now, the macro will send an email with attachment to every recipient that has a folder address in column F:G. I'm trying to make it so that those selected in column B will have an email sent with appropriate attachment in the same row.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adjust email macro to send only select files in a folder rather than all ref'ed in a r

    Please Login or Register  to view this content.
    This will email only the rows from selected cells in column B (or selected cells from any column).

+ 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. Macro To Check For Files in Specfic Paths and Send out Email
    By takeawalkk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2016, 09:59 AM
  2. Help with macro not working - Pull from fields > attach doc from folder > send email
    By mikey386 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2015, 03:42 PM
  3. [SOLVED] Macro lists files in folders & subfldrs - Need to add ability for user to select folder
    By BeachBum08 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2012, 12:15 PM
  4. Replies: 1
    Last Post: 05-22-2012, 02:13 PM
  5. Macro - Collect data - Select folder and loop through all xls files
    By zmalach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2008, 10:37 AM
  6. Macro - Collect data - Select folder and loop through all xls files
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-04-2008, 05:58 AM
  7. Use Macro to Select All Files Within A Folder
    By Theresa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2005, 11:05 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