Results 1 to 3 of 3

code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    code

    I am using the modified code below (thanks for your help John Hugo).

    In "For Each rngCell In Range("H2:I" & i)" section how do I make it (H2:H + I2:I <+120)
    is it also possible to color column D the same as the range (for example if J2 is Yellow D2 is Red and if J3 is orange then D3 is Red)

    Sub cmccabe()
        Dim rngCell As Range
        Dim i As Long
        Application.ScreenUpdating = False
    
    'Depth of Coverage code
        i = Range("J" & Rows.Count).End(xlUp).Row
        For Each rngCell In Range("J2:J" & i)
            Select Case rngCell.Value
                Case Is <= 120
                    rngCell.Interior.Color = RGB(255, 255, 0) 'Yellow
            End Select
        Next rngCell
            For Each rngCell In Range("H2:I" & i)
            If rngCell.Value <= 120 Then rngCell.Interior.Color = RGB(255, 204, 0)
        Next rngCell
        Application.ScreenUpdating = True
    End Sub
    Thanks.
    Attached Images Attached Images

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