Results 1 to 9 of 9

conditional formating

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    conditional formating

    Could you help me to modify the next under defined macro? My request is that depending of the value of the column N I need a background change in the same row but just column A.
    Example: if cell N9 value is 1 then change the background colour of cell A9 (same row) and so on. Other columns contains more data where i don't need conditional formatting.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Set Sheet = Range("N9:N200")
        For Each Cell In Sheet
        
            If Cell.Value = 1 Then
                Cell.Interior.ColorIndex = 3
            End If
            If Cell.Value = 2 Then
                Cell.Interior.ColorIndex = 4
            End If
            If Cell.Value = 3 Then
                Cell.Interior.ColorIndex = 18
                    End If
            If Cell.Value = 4 Then
                Cell.Interior.ColorIndex = 6
            End If
            
            If Cell.Value = 5 Then
                Cell.Interior.ColorIndex = 7
            End If
            
            If Cell.Value = 6 Then
                Cell.Interior.ColorIndex = 7
            End If
                Next
    End Sub
    Attached Files Attached Files
    Last edited by ccsmith; 07-01-2010 at 08:34 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