View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
alexrs2k alexrs2k is offline
external usenet poster
 
Posts: 37
Default Conditional format help

Hi.
You could do this with a macro. All you need to do is open VB Editor
(Alt+F11). In Thisworbook copy this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Lrow As Long
With ActiveSheet
Lrow = .Range("A" & Rows.Count).End(xlUp).Row
i = Lrow
Do While True
If .Range("A" & i).Value < .Range("A" & i - 1).Value Then
Exit Do
Else
i = i - 1
End If
Loop
.Range("A" & i & ":A" & Lrow).Interior.ColorIndex = 8 'Cyan
End With
End Sub

Make sure your data is on column "A". If you need several columns the code
might slightly change. You could also change the default column "A" to
whatever column you wish.
--
Alex
*Remember to click "yes" if this post helped you. Thank you!



"Texas10" wrote:

How can I have a cell be highlighted at the beginning of a certain event?
Here's my example, I have 2 columns and in the right column it's a bunch of
numbers. The numbers are all different but there comes a point when they
start to repeat and I want excel to recognize the repeating cells and
highlight the cell to the left of the start of the repetition. Here's an
example because it's hard to explain, 2 columns and I'll just call one
letters and the other is numbers:
A 2
B 5
C 3
D 8
E 7
F 7
G 7
H 7

So I want it to highlight the cell called E here since it's the start of the
repetition. Any help would be greatly appreciated.