+ Reply to Thread
Results 1 to 5 of 5

create a loop for copy and pasting ranges to outlook email

  1. #1
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76

    create a loop for copy and pasting ranges to outlook email

    hello

    i have a code that works but i currently refeence the tab names. is there a way to create a loop so the code will copy and paste all data in every tab except Sheet1? so something like:

    loop for all sheets except sheet 1 and this inside the loop

    Please Login or Register  to view this content.
    and for it to add 1 to r for every iteration so first loop is r1, second loop is r2 etc

    TIA and any help is appreciated
    i attached the sheet w the working code now for referencereturns.xlsm

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: create a loop for copy and pasting ranges to outlook email

    This may be more than you were seeking however ... the following copies data from all sheets except one. It pastes that data to the exception sheet, then copies that and creates an email
    with the copied data formulated as the body of the email.

    I'm certain there are others methods to obtain the same result but here is one I had. You could a few more lines of code to delete the final compilation sheet/s if desired.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-16-2023
    Location
    Poland
    MS-Off Ver
    Excel 2019 32bit WIN10
    Posts
    88

    Re: create a loop for copy and pasting ranges to outlook email

    My proposition:
    Please Login or Register  to view this content.
    Last edited by Tajan; 10-20-2023 at 05:59 PM.

  4. #4
    Registered User
    Join Date
    10-29-2017
    Location
    Miami, FL
    MS-Off Ver
    2010
    Posts
    76

    Re: create a loop for copy and pasting ranges to outlook email

    this worked, TYVM
    is there a way to paste it and format it with the basic black grid lines in the email?

  5. #5
    Registered User
    Join Date
    10-16-2023
    Location
    Poland
    MS-Off Ver
    Excel 2019 32bit WIN10
    Posts
    88

    Re: create a loop for copy and pasting ranges to outlook email

    Add grid lines to Excel cells.

+ 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. Pasting Range in Outlook Email Error
    By OscarM1998 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-18-2021, 07:55 PM
  2. Pasting Multiple Ranges into Outlook Using Excel VBA
    By jlive24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2018, 02:40 AM
  3. Replies: 0
    Last Post: 05-28-2018, 09:53 AM
  4. Replies: 2
    Last Post: 09-11-2015, 04:24 AM
  5. [SOLVED] Pasting into a new email in outlook?
    By OpOrange in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 07-19-2015, 06:12 PM
  6. Copy data from excel to Outlook new email and create draft.
    By G.Bregvadze in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2013, 03:31 AM
  7. 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

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