+ Reply to Thread
Results 1 to 4 of 4

Formula/VBA to enter worksheet/tab color as a value in a cell

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    13

    Formula/VBA to enter worksheet/tab color as a value in a cell

    I would like to be able to return the color of each worksheet/tab as a value in a cell on each worksheet.

    Example:

    "Sheet 1" - is colored green - Cell "P1" of this worksheet should say green or the excel value of that color
    "Sheet 2" - is colored red - Cell "P1" of this worksheet should say red or the excel value of that color
    "Sheet 3" - is colored blue - Cell "P1" of this worksheet should say blue or the excel value of that color

    Not sure if this is even possible but thought I would ask the experts and see.

    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Formula/VBA to enter worksheet/tab color as a value in a cell

    Something like:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula/VBA to enter worksheet/tab color as a value in a cell

    Each worksheet would need to populate the color of it's tab in the same cell as all the other worksheets. So say you have three green tab worksheets they would all say green in cell P1. Then if you had 5 red color tab worksheets they would all say red in p1.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Formula/VBA to enter worksheet/tab color as a value in a cell

    I'm not telling you where you should put the information. Just a couple of examples of the code to do it.

    You could, for example, have a Workbook Sheet Activate event handler.

    Please Login or Register  to view this content.

    Every time the sheet is activated, it would put the sheet tab colour into cell P1.


    Regards, TMS

+ 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