• Lucid Dreaming - Dream Views




    Results 1 to 4 of 4
    1. #1
      !DIREKTOR! Adam's Avatar
      Join Date
      Jan 2007
      Gender
      Location
      Aquanina's closet
      Posts
      5,194
      Likes
      34

      Conditional formatting in Excel 07

      Guys,

      No idea why this wont work because I've done conditional formatting so much in past projects at work, but I'm trying to set something up for my dad which is a basic spreadsheet of invoices, however the last column is 'paid' and I want to set conditional formatting to say when paid = Y then highlight the whole row as grey for example, but it will only change the cell with the Y in grey - any idea's what I'm missing as sure this is how I used to do it in the past.

      Thanks

    2. #2
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Screenshot?

    3. #3
      !DIREKTOR! Adam's Avatar
      Join Date
      Jan 2007
      Gender
      Location
      Aquanina's closet
      Posts
      5,194
      Likes
      34
      Can as at work, but it's pretty simple:

      I have a row of information, with one cell in the row with a specific condition. When this condition is triggered i.e goes from blank to Y then I want that row to change colour.

      I've a feeling I'm going to have to use VB

    4. #4
      !DIREKTOR! Adam's Avatar
      Join Date
      Jan 2007
      Gender
      Location
      Aquanina's closet
      Posts
      5,194
      Likes
      34
      Balls okay, so I figured I needed to use VB to get this to work, and it kind of does (I'm not a programmer) so I used:

      Private Sub Worksheet_Change(ByVal Target As Range)
      Dim WatchRange As Range
      Dim CellVal As String
      If Target.Cells.Count > 1 Then Exit Sub
      If Target = "" Then Exit Sub
      CellVal = Target
      Set WatchRange = Range("b3:m3") 'change to suit

      If Not Intersect(Target, WatchRange) Is Nothing Then
      Select Case CellVal
      Case "Y"
      Target.EntireRow.Interior.ColorIndex = 5
      End Select
      End If
      End Sub

      HOWEVER, this doesn't colour the range B3:M3 but rather the entire row, also when cell M3="Y" is colours the cell, but when M3="" it leaves it coloured... Any idea's where I've cocked up?

    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
    •