+ Reply to Thread
Results 1 to 3 of 3

Macro AutoHide Worksheets with Numeric Names

  1. #1
    Registered User
    Join Date
    08-26-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Macro AutoHide Worksheets with Numeric Names

    Hello,

    I have 2 macros that do the following:

    Macro 1: Creates a new sheet from a master sheet for each entry in a list and renames the new copy for that entry. The list is a list of years that is formula driven. The list of years is generated from 2 cells: Start year and # of years. So if I have Start year as "2012" and # of years as "2" my list of entries is autofilled by formula resulting in 2012, and 2013. I run Macro 1 and it generates a sheet from a master sheet if they do not already exist and renames the new sheets "2012" and "2013".

    Macro 2: Hides the year sheets from the list above if the entry has an "X" in the cell next to it.

    Macro 2 works great if the list and sheet names are words/text. However, it does not work at all if they are numbers. I have been able to hide a numeric named sheet only under the following conditions: Manually enter the year in my list of entries (no formula) AND manually name a sheet the same year.

    Any suggestions on how I can make the formula driven list and the macro driven named sheet formats match so that macro 2 will function properly?

    Thanks in advance,
    Steve

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Macro AutoHide Worksheets with Numeric Names

    Try declaring the cell value as 'String'.

  3. #3
    Registered User
    Join Date
    08-26-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro AutoHide Worksheets with Numeric Names

    That worked perfectly! Thank you - marking as solved.

+ 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