Results 1 to 14 of 14

Code to Change Tab Color if Data Exists

Threaded View

jscalem Code to Change Tab Color if... 08-28-2013, 06:27 PM
6StringJazzer Re: Code to Change Tab Color... 08-28-2013, 09:25 PM
jscalem Re: Code to Change Tab Color... 09-06-2013, 12:19 PM
6StringJazzer Re: Code to Change Tab Color... 09-06-2013, 02:27 PM
JOHN H. DAVIS Re: Code to Change Tab Color... 09-06-2013, 02:47 PM
6StringJazzer Re: Code to Change Tab Color... 09-06-2013, 05:36 PM
jscalem Re: Code to Change Tab Color... 09-06-2013, 06:31 PM
jscalem Re: Code to Change Tab Color... 09-06-2013, 06:30 PM
fredlo2010 Re: Code to Change Tab Color... 09-06-2013, 10:31 PM
6StringJazzer Re: Code to Change Tab Color... 09-06-2013, 11:08 PM
fredlo2010 Re: Code to Change Tab Color... 09-06-2013, 11:18 PM
Winon Re: Code to Change Tab Color... 09-06-2013, 11:40 PM
fredlo2010 Re: Code to Change Tab Color... 09-06-2013, 11:42 PM
6StringJazzer Re: Code to Change Tab Color... 09-07-2013, 08:57 AM
  1. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code to Change Tab Color if Data Exists

    Another option:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Sh.Name = "Sheet3" Then Exit Sub
    If Sh.UsedRange < 1 Then Sh.Tab.ColorIndex = xlNone
    If Not Intersect(Target, Sh.UsedRange) Is Nothing Then
        Sh.Tab.ColorIndex = 3
    End If
    End Sub
    This will remove the Tab Color as well and operates on all Sheets within the workbook. If there are sheets you don't want included you need to place a line at the beginning. In the sample code above it excludes Sheet3
    Last edited by JOHN H. DAVIS; 09-06-2013 at 03:53 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 05-08-2013, 07:07 AM
  2. VBA Code to change row color
    By adamheon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-07-2013, 05:53 AM
  3. [SOLVED] VBA code to change background color of a row in a spreadsheet
    By michelle27800 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-15-2012, 10:09 AM
  4. Best way to change color of font in code?
    By bobbby1949 in forum Excel General
    Replies: 5
    Last Post: 08-27-2011, 04:50 PM
  5. Change the excel Menu Color with code
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2008, 06:15 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