Results 1 to 5 of 5

Change Row color based on cell value

Threaded View

  1. #1
    Registered User
    Join Date
    12-01-2012
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    4

    Change Row color based on cell value

    Hi,

    I'm trying to change range row color based on cell value.
    my code works but instead of changing range row color it changes entire row.
    I want To change color just in A:H.

    Thank you

    here is my code:
    Sub Roww()
    
    Dim Tim As Date
    Dim oCell As Range
    Dim drow As Integer
    
    Tim = TimeValue("01:09:00")
    
    Sheets("Sheet3").Select
       For Each oCell In Range("d3:d100")
           If oCell.Value > Tim Then
              drow = oCell.row()
             
              Rows(drow & ":" & drow).Select
              
              With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 65535
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    Moderators note: code tags added for you - this time
    Attached Files Attached Files
    Last edited by FDibbins; 12-19-2012 at 01:57 PM.

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.6.0 RC 1