ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Format Macro fails to set interior color - HELP!!! (https://www.excelbanter.com/excel-programming/357741-conditional-format-macro-fails-set-interior-color-help.html)

bttman

Conditional Format Macro fails to set interior color - HELP!!!
 
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



All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com