+ Reply to Thread
Results 1 to 7 of 7

I need a VBA macro to select certain rows in a worksheet and email that as an attachment

  1. #1
    Registered User
    Join Date
    08-31-2019
    Location
    Bangalore
    MS-Off Ver
    O365
    Posts
    27

    I need a VBA macro to select certain rows in a worksheet and email that as an attachment

    I need a VBA macro to select certain rows in a worksheet and email that as an attachment. In the attached sheet the macro should select email address from column BA and mail the selected rows to that e-mail address.

    It should first select all rows with the same address in column BA and send that selection as an attachment to that address, then select all rows with the next email address and email that and so on for all email addresses available in column BA.

    I use Outlook 365
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    Here is one way...Attaches the data as a excel file...Will give you an idea...I don't know what the sheets or workbooks need to be named...Can change as required...
    Please Login or Register  to view this content.
    Last edited by sintek; 02-17-2022 at 09:24 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    08-31-2019
    Location
    Bangalore
    MS-Off Ver
    O365
    Posts
    27

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    This works great, just one thing, i want the worksheet name in each workbook to remain as "Sheet1", is that possible

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-31-2019
    Location
    Bangalore
    MS-Off Ver
    O365
    Posts
    27

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    Thanks my friend!!! This is perfect!!!!

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    .........................
    Thanks.png

  7. #7
    Registered User
    Join Date
    08-31-2019
    Location
    Bangalore
    MS-Off Ver
    O365
    Posts
    27

    Re: I need a VBA macro to select certain rows in a worksheet and email that as an attachme

    interesting situation with this, the same code is working fine on my system, but on another computer it is returning an "Overflow" error on this line of code, any thoughts?
    Please Login or Register  to view this content.

+ 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. [SOLVED] Save worksheet as a PDF and email as attachment
    By colin7 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-02-2019, 06:30 AM
  2. Macro to email pdf attachment to different email addressees
    By Ricky Wilko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2015, 07:43 PM
  3. Macro send worksheet as email attachment?
    By welshman010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2014, 09:36 PM
  4. Macro to send email with attachment for each unique email Ids
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2014, 07:12 AM
  5. [SOLVED] Show worksheet name on Email attachment
    By birchetts in forum Outlook Formatting & Functions
    Replies: 8
    Last Post: 04-24-2012, 07:40 AM
  6. select certain columns to be attached in email attachment
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2011, 03:00 PM
  7. email excel file or worksheet as an attachment to multiple email addresses
    By jgeagle5 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 03:40 PM

Tags for this Thread

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