+ Reply to Thread
Results 1 to 8 of 8

Macro for extracting data from multiple worksheets from multiple workbooks

  1. #1
    Registered User
    Join Date
    09-05-2018
    Location
    Bucuresti
    MS-Off Ver
    1807
    Posts
    4

    Macro for extracting data from multiple worksheets from multiple workbooks

    Hello guys.

    I'm new to this forum and mainly in VBA. Started to learn it for work, in order to create automatized documents that will make life easier ^.^

    I have a code that basically opens a windows explorer window where you can select multiple workbooks, and extracts data from them ( it detects the last row and column ) into a master workbook. It works great, but the problems is that it extracts only from the active sheets, not from all sheets from those workbooks. The workbooks will always have the same sheet names ( e.g Workbook 1 - Sheet 1, Sheet 2, Sheet 3, Workbook 2 - Sheet 1, Sheet 2, Sheet 3 etc ). I even tried to use Array, but with no luck.

    This is my code so far.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,055

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Another option:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Rule 08: Cross-posting Without Telling Us

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question. If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    If you have less than 10 posts, do not try to copy and paste the link. Instead, type the link out in your thread.

    No further help to be offered, please, until the OP has complied with this request.
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Registered User
    Join Date
    09-05-2018
    Location
    Bucuresti
    MS-Off Ver
    1807
    Posts
    4

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    I'm sorry, I didn't knew about this rule. It won't happen again. Thank you for notifying me .

    As I'm not able to post links, I asked the same question on MrExcel Forum, but the received answer didn't helped me ( forum/excel-questions/1068049-macro-copying-same-range-multiple-worksheets.html )

  6. #6
    Registered User
    Join Date
    09-05-2018
    Location
    Bucuresti
    MS-Off Ver
    1807
    Posts
    4

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Quote Originally Posted by Greg M View Post
    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Thank you, it works perfect. I have only 1 question. It can be possible to exclude 1 sheet from being copied ?

  7. #7
    Registered User
    Join Date
    09-05-2018
    Location
    Bucuresti
    MS-Off Ver
    1807
    Posts
    4

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Quote Originally Posted by Mumps1 View Post
    Another option:
    Please Login or Register  to view this content.
    Thank you, but it doesn't copy the data in the format I need.

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Macro for extracting data from multiple worksheets from multiple workbooks

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    See if the following code will allow you to exclude a specific worksheet from the data copying process:

    Please Login or Register  to view this content.
    The highlighted value should be the name of the worksheet which you wish to exclude.


    Hope this helps - as before, please let me know how you get on.

    Best regards,

    Greg M

+ 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] Combining data from multiple Worksheets located in multiple Workbooks
    By ExcelRookie2016 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2016, 04:55 PM
  2. [SOLVED] Consolidate all data in multiple worksheets of multiple workbooks in one Master file.
    By adil.master in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2014, 09:59 PM
  3. How can I create a macro for extracting data from multiple workbooks within a folder
    By surfing69 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2013, 11:36 AM
  4. Required Macro for combine multiple workbooks which contains multiple worksheets
    By DHANASEKARAN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2013, 03:20 PM
  5. Replies: 0
    Last Post: 07-29-2013, 03:00 AM
  6. Need to combine data from multiple worksheets in multiple workbooks into 1 worksheet
    By ginric99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2013, 07:58 AM
  7. Replies: 3
    Last Post: 01-05-2013, 02:20 AM

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