Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Based upon your previous post I guess that you want something like this
Sub Test() Dim iLastRow As Long Dim i As Long iLastRow = Cells(Rows.Count, "P").End(xlUp).Row For i = 1 To iLastRow With Cells(i, "P") Select Case .Value Case "GI": Cells(i, "A").Resize(, 12) _ .Interior.ColorIndex = 46 'orange Case "CA": Cells(i, "A").Resize(, 12) _ .Interior.ColorIndex = 6 'yellow 'etc. End Select End With Next i End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Alex" wrote in message ... Hi, I'm pretty new with VBA. I'm trying to highlight a range of cells for example (A10:N500) based on cells located in column P. If P10=CA Then A10:N10 will be highlighted yellow Else If P11=GI Then A11:N11 will be highlighted orange and about three more coniditons. I would appreciate a code for this. -Thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting with conditions based on another range | Excel Worksheet Functions | |||
shade cells based on conditions - i have more than 3 conditions | Excel Worksheet Functions | |||
Highlighting Range of Cells based on another cell with 5 condition | Excel Programming | |||
Add cells from a range based on 2 conditions from 2 other ranges | Excel Worksheet Functions | |||
Macro to input formula in range based on another range | Excel Programming |