+ Reply to Thread
Results 1 to 7 of 7

vba to change tab colors based on a cell value

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    43

    vba to change tab colors based on a cell value

    Hello!

    I have learned that I can have tab colors change based on the value of a cell. Here's the problem - I need the cell to be one on a different tab. I have a table of contents tab called Assignments. When Tab A's work is complete I enter the date in a cell on Assignments tab that it was complete. I would love to have the tab color for Tab A to change based on if there is a date in the Assignments tab (cell E4).

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,981

    Re: vba to change tab colors based on a cell value

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your Assignments sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a date in E4. Exit the cell and the tab color for "A" will change to red.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: vba to change tab colors based on a cell value

    That's great! I have more than one sheet so I can add it several times and change the cell reference and sheet names to match? Also, I have a check out and check in for the assignments so D4 means teh work is out and E4 means its completed. I tried duplicating the code and changing the cell reference and color but it didn't work.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,981

    Re: vba to change tab colors based on a cell value

    I think that it would be much easier to follow if I could see how your data is organized. Could you post a copy of your file? Include a detailed explanation of what you would like to do referring to specific cells and worksheets.

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: vba to change tab colors based on a cell value

    See attached for Dummy Sheet. If there is a date under out then I need the tabs to turn blue when a date is entered into the completed side I need to tab to change to green.
    Attached Files Attached Files

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,981

    Re: vba to change tab colors based on a cell value

    Try:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba to change tab colors based on a cell value

    See if this does what you want.
    Attached Files Attached Files

+ 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. Replies: 3
    Last Post: 10-21-2015, 03:51 PM
  2. Change Cell Color to Gradient Based on Adjacent Cell Colors
    By Weathertuck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2013, 04:49 PM
  3. [SOLVED] How to change or populate cell values based on cell colors
    By MrMacroMan in forum Excel General
    Replies: 8
    Last Post: 05-02-2012, 11:34 AM
  4. Change Cell Fill Color Based on Colors in 2 Columns
    By djkante in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2010, 08:07 PM
  5. Replies: 2
    Last Post: 08-01-2007, 07:00 PM
  6. Replies: 1
    Last Post: 02-05-2005, 02:06 PM
  7. [SOLVED] Is it possible to change colors of cells based on value in cell (.
    By LC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2005, 02:06 AM

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