Hi,
I need help to solve this issue.
I have one conditional format formula:
=IF(C30="";FALSE;SUMPRODUCT((C30>=INDIRECT("Table135[Start]"))*(C30<=INDIRECT("Table135[End]"))))
Because I have some tables i need to change to:
=IF(C30="";FALSE;SUMPRODUCT((C30>=INDIRECT("Table13512[Start]"))*(C30<=INDIRECT("Table13512[End]"))))
I try the following code but don't work. What is wrong?
Sub CondFormat()
Range("C9:AR9").Select
tb1 = "Table13512[Start]"
tb2 = "Table13512[End]"
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(C30="";FALSE;SUMPRODUCT((C30>=INDIRECT(" & tb1 & "))*(C30<=INDIRECT(" & tb2 & "))))"
.FormatConditions(1).Interior.ColorIndex = 40
End With
End Sub
I know that tables names must be inside of " " but until now I can't solve this issue.
Maybe have another way to solve this also, I'm not experient in VBA code.
Many thanks in advance.
Luis
Bookmarks