PDA

View Full Version : Solved: Multiple Column Colour Change



khalid79m
04-15-2010, 06:25 AM
With ThisWorkbook.Sheets("Agent_View")
For i = 18 To 47
With .Cells(i, "M")
If IsNumeric(.Value2) Then
Select Case .Value2
Case Is <= 200: .Interior.ColorIndex = 43
Case Is <= 250: .Interior.ColorIndex = 44
Case Is >= 251: .Interior.ColorIndex = 3
End Select
Else
Cells(i, "M").Interior.ColorIndex = 0
End If
End With
Next i
End With

Hi all this code was build with the help of xld, i need to make changes to it so it doesnt only look at column M.

I need it to do this in column M,P, U,X, AC,AF , AK,AN, AS,AV.

Can anyone help or do i just do 10 blocks of repetitve code ?

mdmackillop
04-15-2010, 06:34 AM
For Each a In Array("A", "B", "C")
With ThisWorkbook.Sheets("Agent_View")
For i = 18 To 47
With .Cells(i, a)

khalid79m
04-15-2010, 09:33 AM
thanks mdmackillop , works a treat