+ Reply to Thread
Results 1 to 4 of 4

Selecting Sheet based on tab color

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Selecting Sheet based on tab color

    Hello,

    I'm fairly new to VBA scripts, but I'm trying to make a table of contents page, but depending on the tab color and/or name, I wanted it to display something else. Right now, I have:
    Please Login or Register  to view this content.
    But what if some of my sheets have different names, like "SAMPLE," and what if I need the "TextToDisplay" command to be TextToDisplay:="='APP" & i & "'!A5" depending on a different sheet color?

    Sorry, I hope my question makes sense.

    Thanks very much for any help.
    Last edited by Leith Ross; 02-20-2014 at 04:55 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Selecting Sheet based on tab color

    So you can use if statments and the colorindex property.

    The following code will loop through all of the tabs and display the color#

    Please Login or Register  to view this content.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Selecting Sheet based on tab color

    Hi, and thanks for the input. After running the macro, I obtained the color index code and amended my original syntax to:

    Please Login or Register  to view this content.
    However, the table of contents still displays the cell value of A2 regardless of the value I insert in ColorIndex. Any additional input is very much appreciated!

  4. #4
    Registered User
    Join Date
    02-20-2014
    Location
    LA
    MS-Off Ver
    Excel 2013
    Posts
    27

    Re: Selecting Sheet based on tab color

    Ah, I found it out!

    Please Login or Register  to view this content.
    Yay.

+ 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. Selecting a set of values from one work sheet based on a selection in another sheet
    By Abhimany in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2012, 10:24 AM
  2. Selecting a sheet based on name
    By axecel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2010, 09:20 AM
  3. Excel 2007 : selecting data based on color
    By chuukuni in forum Excel General
    Replies: 0
    Last Post: 07-07-2009, 10:31 AM
  4. [SOLVED] Selecting sheets based on cell in each sheet
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2006, 02:50 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