conditional formating

H

Harryd

I have used the code below, how do I run it for a table of existing data

Private Sub Worksheet_Change(ByVal Target As Range)

Dim icolor As Integer



If Not Intersect(Target, Range("A1:AA200")) Is Nothing Then

Select Case Target

Case 15000 To 20000

icolor = 4

Case 14000 To 14999

icolor = 43

Case 13000 To 13999

icolor = 10

Case 12000 To 12999

icolor = 6

Case 11000 To 11999

icolor = 44

Case 10000 To 10999

icolor = 45

Case 9000 To 9999

icolor = 46

Case 8000 To 8999

icolor = 3

Case Else

icolor = 2

End Select

Target.Interior.ColorIndex = icolor

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

Similar Threads

Cell coloring problem 3
worksheet_change 1
Multiple Contional Formatting 1
Coloring cells 2
worksheet_change 5
VBA Help 2
relating to named range in vba 3
Conditional Formatting using VBA 5

Top