+ Reply to Thread
Results 1 to 9 of 9

Looping through Filter and then copying the data so I can paste or put into outlook body

  1. #1
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    Looping through Filter and then copying the data so I can paste or put into outlook body

    I currently have a spreadsheet where I filter by Rep Name and then I copy the filtered the results into an email and send to each rep individually. Just trying to automate this through code where it will filter by each rep listed then copy the data (as a range??) so I can copy or even load an outlook email.

    I have attached a dummy test workbook with the data as well as screenshots of the email I currently send at the bottom of the data.

    Thank you for any help or direction.

    Josh
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hi Josh

    This Link explains how to do as you describe. If you need help adapting let me (us) know.

    http://www.rondebruin.nl/win/s1/outlook/amail4.htm
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

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

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hello Josh,

    No disrespect to John but I have never seen any code to do what you want. The attached workbook is an automated version of your original based on your requirements.

    I have added a second sheet that contains a list of the reps and their email addresses. There is a button on this sheet that will send an email to each rep in the list after the first sheet is filtered by the rep's name.

    You will need to change the subject line of the email macro "SendEmails" to what you want. It is highlighted in blue font. Here are the macros that have been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hi Josh and Leith

    I did give an incorrect Link to Josh but this Code by Ron Debruin does as Josh describes as his requirements.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Thank you John & Leith for the reply and help. I downloaded Leith's workbook and it does exactly what I was looking for and I haven't had a chance to check out John's reply from this AM. One question I have, is there anyway to have the subtotal line BOLD or BIGGER FONT or even an extra space? How I was doing it currently was adding a blank like so it was easy to see the subtotal.

    Thank you again,

    Josh

  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

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hello Josh,

    Isn't the subtotal row simply "pushed" down when a new entry is made? If the answer is yes then you can format this row as you like,

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hi Josh

    I'll defer to Leith on this one...my point was that Code does exist on the Internet to do as you require (with modification).

  8. #8
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    Hi Leith,

    For some reason I cannot get each rep to subtotal, just shows all the line items and is copied over to email just fine... but it is missing the subtotal...

    Not sure if I am doing something wrong, I went back the original workbook you sent over and getting same results.

    Thank you,

    Josh

  9. #9
    Registered User
    Join Date
    10-27-2016
    Location
    india
    MS-Off Ver
    2013
    Posts
    1

    Thumbs up Re: Looping through Filter and then copying the data so I can paste or put into outlook bo

    HI JOSH,

    Thanks a lot........... codes shared by you is working fine BUT I DON'T WANT PAST DATA ON MAIL BODY INSTEAD OF IT I WANT TO ATTACHE IT AS EXCEL FILE WITH MAIL. Plz guide if possible ,for your help I will be indebted to you forever.

+ 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. Paste Conditional formatting into Outlook email body
    By tabkaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2013, 07:58 PM
  2. Export outlook body data to excel
    By elfeste in forum Outlook Programming / VBA / Macros
    Replies: 10
    Last Post: 06-05-2013, 06:55 AM
  3. Convert text into bitmap and paste on mail body of outlook
    By Deepak -WFM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2013, 07:12 AM
  4. Copy and Paste Union of Ranges/Rows to Outlook Email Body
    By darkhunter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2012, 01:52 PM
  5. Copying Excel worksheet in Outlook email body
    By xatomicx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2010, 01:38 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