Results 1 to 16 of 16

Thread: Worksheet Function Change Row Colors According to Value

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    May 2004
    Location
    UK
    Posts
    71
    Location

    Worksheet Function Change Row Colors According to Value

    I have done a service schedule in Excel, What i am trying to get it to do is when you put an "x" in a cell it will automatically change the color of the cell.
    Below is the code i have written, Can someone throw some light on what i am doing wrong(probaly everything)
    Thanks
    Ian


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim x As Integer
    Dim s As Integer
    Dim m As Integer
      With Range("A1:z150")
        If Cells.Value = x Then
            Cells.Interior.ColorIndex = 34
            If Cells.Value = s Then
                Cells.Interior.ColorIndex = 32
            End If
        End If
    End With
    End Sub
    Last edited by Aussiebear; 04-27-2023 at 04:19 PM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •