Question Locked

Macro Code - Need Help. Please

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can someone have a look at the Excel Code that I am using to find out why the "Completed" section does not work.

Your help will be greatly appreciated.

Sub Update_Row_Colors()

Dim LRow As Integer
Dim LCell As String
Dim LColorCells As String

LRow = 2

While LRow < 2000

LCell = "B" & LRow

LColorCells = "A" & LRow & ":" & "AJ" & LRow

Select Case Left(Range(LCell).Value, 12)

Case "Accepted"
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = 4
Range(LColorCells).Interior.Pattern = xlSolid

Case "Invoiced"
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = 6
Range(LColorCells).Interior.Pattern = xlSolid

Case "Completed"
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = 15
Range(LColorCells).Interior.Pattern = xlSolid

Case "Not Accepted"
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = 3
Range(LColorCells).Interior.Pattern = xlSolid

Case Else
Rows(LRow & ":" & LRow).Select
Range(LColorCells).Interior.ColorIndex = xlNone

End Select

LRow = LRow + 1
Wend

Range("A1").Select

End Sub

4 replies

by oldbaritone

What color pallette are you using? In the old (archaic) 16-color pallette, 15 would be "Bright White" which is probably the same color it already is.

So it may be working, just changing it to the same color.

by fpeu

On XL 2003 it does work, by having "Completed" in B2,the code highlights the row, and fill it with Grey.

Is this what you wanted to perform?
What excatly is not working?

by lukcasem

Thank you. I am using EXCEL 2007 and left out one character, which I later found.

This discussion is closed to new replies.