Conditional Format Macro fails to set interior color - HELP!!!

B

bttman

Cell B3 has a data validation dropdown list.
When I change the selection it triggers a function on for that
worksheet object:

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case Range("ModType").Address
ValidateCoding
End Select
End Sub

Where ModType is the range name for B3

The ValidateCoding routine lincludes:

With Range("Coding")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression,
Formula1:=formatstring
.FormatConditions(1).Interior.ColorIndex = 3
End With


where the "Coding" range refers to cell B4.

The formula part of the conditional formatting works fine, but I cannot
seem to get the FormatConditions(1) to accept a color. If I run the
same command directly as a subroutine it works fine???

HELP!
Thanks in advance!
joe
 

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