+ Reply to Thread
Results 1 to 4 of 4

Copy certain tabs to a new workbook based on criteria

  1. #1
    Registered User
    Join Date
    02-04-2017
    Location
    Belfast
    MS-Off Ver
    2013
    Posts
    7

    Copy certain tabs to a new workbook based on criteria

    Howdy folks - I think this should be easy enough to solve based on one criteria and copying to one new workbook as paste special/values. But I think someone could possibly even solve my issue further so that after copying to a new workbook based on one criteria, the macro goes on copying certain tabs to the next workbook based on the next criteria. Let me explain

    Tab names as follows:
    Menu, Tab 1, Tab 2, Tab3....................... Tab50

    Each tab contains a persons name in cell G1:
    Danny
    John
    Gavin
    Mark
    etc.

    Danny has his name in 10 of the 50 tabs.

    So I have a unique list of the names in the Menu tab cells A1:A30, assuming 30 different names.

    Is it possible to get a macro to go to cell A1 within the Menu tab which equals Danny,
    Looks for this in G1 of all the tabs in the workbook
    Copies tabs that have Danny in cell G1 to a new workbook and saves as paste special>values
    Then moves to the next cell in menu A2 which contains the name John,
    Looks for this in G1 of all the tabs in the workbook...

    So by the end I have 30 Workbooks with each person's workbook containing all their sheets which are applicable to them based on cell G1 with their name in it.

    Thanks in advance folks - I have tried this a little but I don't understand how to do the same step over again and move on to the next criteria. Must go on a course for this.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy certain tabs to a new workbook based on criteria

    This seems like it should work:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-04-2017
    Location
    Belfast
    MS-Off Ver
    2013
    Posts
    7

    Re: Copy certain tabs to a new workbook based on criteria

    This is legendary - works perfectly! Thank you very much.

    Can I be really annoying and put in one small (I think?) addition... is it possible that if column B of the Menu tab contains each person's age group, that the files are saved as Age Group - Name?

    So the menu tab contains the information as follows:
    A B
    Danny Senior
    Gavin Under 21
    Mark Senior

    But the file is saved as column B - column A

    e.g. Senior - Danny
    Under 21 - Gavin
    Senior - Mark

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy certain tabs to a new workbook based on criteria

    Tweaking on the SaveAs line:
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Copy Data from workbook into another based on certain criteria
    By Rossko7226637 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2015, 08:48 AM
  2. Copy cell value from 1 workbook to another workbook based on criteria
    By ezonemy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2014, 04:02 AM
  3. Hide Workbook Tabs Based on Certain Criteria
    By pugsly8422 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-24-2014, 08:21 PM
  4. [SOLVED] copy Tabs, based on two criteria in column J and paste values
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-13-2013, 03:46 PM
  5. Copy two cells in on workbook to another workbook based on two criteria, but more
    By oldboots in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 06:17 AM
  6. Copy two cells in on workbook to another workbook based on two criteria, but more
    By oldboots in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2013, 05:44 AM
  7. Copy Data to New Workbook based on Criteria
    By jimbean in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2008, 03:06 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