Conditional formatting

A

Andre

Hi Guys

I have looked in conditional formatting section but haven't been able to
find a solution to this problem.

I have a table of text imported daily into cells range A1:AA50
The latest data is that in column A
I therefore need to be able to move my cursor down or up column A at my
discression, and as the cursor moves to each new cell location, so the
background colour of all cells in the range with the matching text should
highlight.

Any idea??
 
D

Dan R.

Put this in ThisWorkbook, not in a module:

Private Sub Workbook_SheetSelectionChange( _
ByVal Sh As Object, ByVal Target As Range)
Dim rng As Range
Set rng = Sh.Range("A1:AA50")
rng.Cells.Interior.ColorIndex = 0
If Target.Column = 1 And _
Target.Cells.Count = 1 Then
For Each cell In rng
If cell = Target.Value Then
cell.Interior.ColorIndex = 8
End If
Next cell
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top