PDA

View Full Version : Referring to the first and last cell of a range



YasserKhalil
08-06-2010, 01:56 PM
Hi everybody
I have applied a conditional formatting on the range.
I'd like to refer to the first cell of this range depending on the fill colour that I applied in conditional formatting

This is the code that I used and succeeded in the normal colouring but with the conditional formatting it fails


X = 0
Do
X = X + 1
Set Rng2 = Cells(4, X)
Loop Until Rng2.Interior.ColorIndex = 7

mikerickson
08-06-2010, 03:04 PM
What condition triggers the CF?

Its easier to test for that than it is to test what color the CF has made the cell.