Consulting

Results 1 to 9 of 9

Thread: Changing Tab color to "No Color"

  1. #1
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location

    Changing Tab color to "No Color"

    I am working on a macro to change tab colors based on two factors but I need to be able to change the tab color to "No Color" if the factors change. I have the code changing the tab colors but I am unable to get it to return to "No Color".

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    Macro recorder will usually point you in the right direction

        ActiveWorkbook.Sheets("Sheet1").Tab.Color = xlNone
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location
    Thank you your help, How can I keep the same font style as a standard tab?

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    I didn't think changing the tab color would change the font.

    Does it?

    Also what do you mean by a 'standard tab'?
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location
    When I use the macro to set the color to "xlNone" the font color turns to black (see below) the other fonts are blue. If I manually change the tab color to "No Color" the tab font changes to light blue as shown below.


    Excel Tabs.jpg
    Attached Images Attached Images
    Last edited by oam; 08-14-2015 at 04:11 PM.

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    See if this is any better. I don't have the blue colors on mine

    Capture.JPG

        With ActiveWorkbook.Sheets("Sheet1").Tab
            .ColorIndex = xlAutomatic
            .TintAndShade = 0
        End With

    The other thing to try would be to record a macro while you manually reset the color
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location
    It does not return it to how the tab was before but I may have to change it manually. Do you know how to change the font colors?

    Thank you for your help

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    I think those parameters are part of the Theme - look at the picture and explore with your configuration.

    The quickest thing I could suggest is to record a macro to do what you want, and then incorporate the resulting code




    Capture.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  9. #9
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location
    Thank for your help! I think I have gone as far with this as I can; nowhere in the web info tells how to change the tabs back to there pervious theme so I picked a color that stands out and should work.

    Again, thank you for all your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •