PDA

View Full Version : text in cell in condition



tkaplan
06-18-2020, 11:02 AM
Hi,
i'm trying to do something that i believe is really simple, and for some reason i can't get it to work.
i have a named range named ReductionType. I want columns I:J to be hidden if the text in reductionType is "One Time". otherwise i want columns G:H hidden

I have:

Sub Macro3()


Columns("G:J").EntireColumn.Hidden = False

Dim reduction As String
reduction = Range("ReductionType")
IIf reduction = "One Time Premium Reduction", Columns("I:J").enitrecolumn.Hidden = True, Columns("G:H").EntireColumn.Hidden = True


End Sub

and i'm getting errors.
any ideas please?

thanks!

tkaplan
06-18-2020, 11:02 AM
i also tried with reduction = Range("reductionType").value