Question

Locked

Macro Code - Need Help. Please

By lukcasem ·
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

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Pallette?

by oldbaritone In reply to Macro Code - Need Help. ...

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.

Collapse -

Details...

by Fpeu In reply to Macro Code - Need Help. ...

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?

Collapse -

XL2007 Macro Code

by lukcasem In reply to Details...

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

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Forums