+ Reply to Thread
Results 1 to 6 of 6

Thread: Conditional formatting

  1. #1
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Conditional formatting

    I need help appling multiple conditional formats based on cell text. The attached test sheet shows the formatting in place now but I need to be able to add more based on text selected from the drop down in column H, Text enterd in column P, and date ranges listed in column I,M,and N. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,523

    Re: Conditional formatting

    Versions of Excel earlier than 2007 are limited to three conditional formats.
    You would need to use VBA to get around this limitation.

    Get Around Excels 3 Criteria Limit in Conditional Formatting
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Conditional formatting

    Tried some examples from the link provided with no luck

    Sub TheSelectCase1()

    Select Case Range("H8").Text

    Case "COMPLETE"

    Range("A8").Value = "DONE"


    End Select

    End Sub

    I need cell color of A8 to change when H8 equals complete.

  4. #4
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,523

    Re: Conditional formatting

    Well, the syntax of the VBA code on that page is pretty clear and what you have posted is no where close to it.
    Here is code example specific to your workbook, though all Case Statements have not been developed.
    This code must go into the worksheet module accessed via right-clicking the sheet tab and choosing View Code. Copy this code and paste it into the code window of the VB Editor.
    You should be able to see the pattern in this code easily. You did not specify what color Cells in column-A should be, so the value for iColor for each Case will need to the changed per your needs.

    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    
        Dim iColor As Long
        
        If Target.Cells.Count > 1 Then Exit Sub
        
        If Not Intersect(Target, Columns("H:H")) Is Nothing Then
            If Target.Row > 7 Then
                Select Case Target.Value
                    Case "COMPLETE": iColor = 5
                    Case "READY": iColor = 7
                End Select
            End If
            Range("A" & Target.Row).Interior.ColorIndex = iColor
        End If
    
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Conditional formatting

    Some questions;
    1. looks like I have to remove the conditional formatting already applied to all cells on the work sheet in order to get formatting in VBA to work, correct?
    2. I am not sure how to get the entire row up to column Q to change color based on text selected in column H. On the attached example provided originally cell color fro A8 to Q8 changes when DELAYED is selected.
    3. What is the priority in the VBA code, again , on the attached example, A to Q is shaded grey when MCPA appears in column P. However A to Q shading is orange when DELAYED appears in column H.
    I appreciate your help and patience in solving this issue.

  6. #6
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Conditional formatting

    Just need direction on how to increase the range to include A to Q

+ 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.2.0