+ Reply to Thread
Results 1 to 5 of 5

Copy cell ranges from multiple worksheets to one worksheet?

  1. #1
    Forum Contributor
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2013
    Posts
    131

    Copy cell ranges from multiple worksheets to one worksheet?

    Hey there! After much scrounging I was able to get a Macro on button click to copy a cell range from one workbook to another.

    It works great! Here's the code I'm currently using that works like a champ:

    Please Login or Register  to view this content.
    This works great if I only want to copy from one source document. In this instance, I'd like to copy from multiple docs though, all in the same directory. So, for example, I'd like to copy cell range A3:H15 from WPD Doc TEST to A2:H14 on Reporting Doc TEST (what the above SUB is doing currently), but then copy the same cell range from a different WPS book (so like, WPS Doc TEST2) to a new range in the same destination workbook (Reporting Doc TEST). I'd like to be able to do this as many times as needed, but I need to figure out how to just get a 2nd one working first, then I can figure out the rest.

    Any help would be stellar. Thanks!
    Last edited by mrbusto71; 02-17-2016 at 12:47 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy cell ranges from multiple worksheets to one worksheet?

    Just follow your working template but add a new variable in for the new workbook and specify the new range

    Example:

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Contributor
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2013
    Posts
    131

    Re: Copy cell ranges from multiple worksheets to one worksheet?

    Awesome! Yeah, I couldn't figure out if I needed to Set x multiple times as the same variable or differentiate them somehow. That's super easy then, thanks! +Rep for you, sir/madam.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy cell ranges from multiple worksheets to one worksheet?

    Thanks for the rep. Technically you could use the same variable over and over provided you "Set" it to something different each time. I like to give it a number though so that it is easier to distinguish if you ever need to modify the code.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy cell ranges from multiple worksheets to one worksheet?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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: 4
    Last Post: 08-25-2015, 12:00 PM
  2. Replies: 1
    Last Post: 10-21-2013, 01:10 PM
  3. Replies: 0
    Last Post: 08-05-2013, 11:34 AM
  4. Copy ranges from multiple worksheets in excel and then paste special in Powerpoint
    By mclarke2030 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-25-2013, 04:47 PM
  5. Replies: 2
    Last Post: 01-03-2013, 01:29 AM
  6. Copy multiple named ranges to worksheet
    By PShingadia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2012, 11:50 AM
  7. copy ranges from multiple worksheets
    By simora in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2005, 09:06 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