+ Reply to Thread
Results 1 to 5 of 5

Re-Naming Sheets per Cell data & Hiding Sheets

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re-Naming Sheets per Cell data & Hiding Sheets

    Hi! I could really use some help setting up my worksheets for 30 products.

    on sheet1 I have a button I need to do the following when clicked:
    (1) name the next 30 sheets based on cell values in sheet1
    (2) for those 30 sheets, hide some of them based on a y/n input in sheet 1

    To clarify: the worksheets do not need to be created, they already exist. They just need to be renamed and hidden based on that y/n criteria.

    Please see attachment with just 1 worksheet for clarification...
    So - The next 30 sheets are to be named by the following ranges (B7:B16), (B21:B30) and (B35:B44)

    For every product with a "n" in column C of sheet1, the worksheet for that product needs to be hidden.


    I hope this makes sense... any help is GREATLY appreciated.
    Attached Files Attached Files
    Last edited by dej222; 08-26-2009 at 10:22 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Re-Naming Sheets per Cell data & Hiding Sheets

    It would be easier if you arranged the data on Sheet1 in database fashion, adding a column for business unit (if it's necessary), a single header row, and deleting the rows having inconsistent format.
    Entia non sunt multiplicanda sine necessitate

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

    Re: Re-Naming Sheets per Cell data & Hiding Sheets

    This macro will do what you want. The sheets must be in order. Use a FORMS button instead of a Control Toolbox button, a Form button lets you attach a normal macro stored in a normal module like Module1.
    Please Login or Register  to view this content.
    EDIT: Tip to SHG, this stuff is easier when standard data layouts are used.
    _________________
    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!)

  4. #4
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180

    Re: Re-Naming Sheets per Cell data & Hiding Sheets

    I completely agree with shg but if you must keep it in that format, give this a shot. Little overkill but it gives you some flexibility with adding sheets (business unit D, E, etc)

    It assumes all the sheets follow sheet 1.


    Please Login or Register  to view this content.
    jtp

  5. #5
    Registered User
    Join Date
    06-09-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Re-Naming Sheets per Cell data & Hiding Sheets

    JB, I tried the code you gave and received a 400 error. Not sure what was happening there but I am trying to figure it out.

    JTP, this works perfectly! and I like the flexibility. This will be a good lesson for me trying to break down how your code works. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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