Number of Conditional Formats

B

Bob Phillips

You either do it with VBA event code, like so

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("A20")) Is Nothing Then
Select Case Target.Value
Case 1: Target.Interior.ColorIndex = 1
Case 2: Target.Interior.ColorIndex = 2
Case 3: Target.Interior.ColorIndex = 3
Case 4: Target.Interior.ColorIndex = 4
Case 5: Target.Interior.ColorIndex = 5
Case 6: Target.Interior.ColorIndex = 6
End Select
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

or you could try http://www.xldynamic.com/sourc­e/xld.CFPlus.Download.html


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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