Results 1 to 3 of 3

If Cell.Value= "test" Fill Range with colour

Threaded View

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    If Cell.Value= "test" Fill Range with colour

    Hi, I've named range C1:X1 as RANGE
    What i need is excel to seach the range for values equals to test and then shade the cell from the active cell to the cell 10 rows below. Currently my code is like this :

    Sub ChangeColor()
    
        Dim rCell As Range
    
        With Sheet1
            For Each rCell In .Range("RANGE").Cells
                If rCell.Value = "Test" Then
                    rCell.Interior.ColorIndex = 15
                    rCell.Select
                    Selection.AutoFill Destination:=Range("???"), Type:=xlFillFormats
                End If
            Next rCell
        End With
    
    End Sub
    Anyone know what should I replace with the Range? Thanks in advance. I'm using excel 2003 by the way.
    Last edited by rename; 12-10-2012 at 12:49 AM.

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