Results 1 to 4 of 4

problem coloring sheet tab based on a condition

Threaded View

  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    La, CA
    MS-Off Ver
    Excel 2003
    Posts
    70

    problem coloring sheet tab based on a condition

    hey everyone

    i'm using this code below to color sheet tab if string "9.9999" found in column "A" on an excel sheet.

    Dim ws As Worksheet
    Dim wb As Workbook
    FoulTime = "99999"
    Dim rng As Range
    
    Set wb = ThisWorkbook
    For Each ws In wb.Worksheets
              
             ws.Columns("a:a").AutoFit
             
        Set rng = ws.UsedRange.Find(FoulTime)
            
            If rng Is Nothing Then
            ws.Tab.ColorIndex = 4
               
            Else
            ws.Tab.ColorIndex = 3
           
                  End If
                 
        Next ws
    recap: if "9.9999"found Color Tab = Red, if not Green.
    The problem is what if wanted the Color to become red if both strings "9.9999" OR/AND "0.0000" found?

    how do i do ?
    thanks in advance
    regards
    Last edited by mehdoush; 05-18-2009 at 01:26 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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