+ Reply to Thread
Results 1 to 3 of 3

How can I change sheet tab color based on cell value in sheet?

  1. #1
    SCAScot
    Guest

    How can I change sheet tab color based on cell value in sheet?

    I use an Excel spreadsheet form to track various landscaping projects. I
    denote the status of the project by using colors assigned by conditional
    formatting based on the value of a status drop-down listbox on the sheet,
    which works great, but I'd also like the tab color of the sheet to match the
    status the various status colors I've chosen. Is there a way to do this?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello SCAScot,

    You can't change the color of the Worksheet tabs. The Tabs object class doesn't have a BackColor property like most objects, and the other obstacle is Excel doesn't expose the Worksheet Tab properties through VBA.

    Sincerely,
    Leith Ross

  3. #3
    Rowan Drummond
    Guest

    Re: How can I change sheet tab color based on cell value in sheet?

    Unless you are using Excel 2002 or late in which case you can. This
    examle changes the tab color every time the value in Cell A1 changes.
    This is worksheet event code. Right click the sheet tab, select view
    code and paste the event in there. Change it to suit your needs:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count = 1 Then
    If Target.Address = "$A$1" Then
    Select Case Target.Value
    Case 5
    Me.Tab.ColorIndex = 36
    Case 6
    Me.Tab.ColorIndex = 35
    Case Else
    Me.Tab.ColorIndex = xlNone
    End Select
    End If
    End If
    End Sub

    Hope this helps
    Rowan

    Leith Ross wrote:
    > Hello SCAScot,
    >
    > You can't change the color of the Worksheet tabs. The Tabs object class
    > doesn't have a BackColor property like most objects, and the other
    > obstacle is Excel doesn't expose the Worksheet Tab properties through
    > VBA.
    >
    > Sincerely,
    > Leith Ross
    >
    >


+ 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