1

Confused about a Run-Time error I am receiving. I'm building a tool that changes formulas by state. No problem building the Excel If functions, but when I clear the below I run into an issue at Range("C13")...

Sub clearICRs()

    Range("B2").Value = "(Select State)"
    Range("C4:C8,C11,C18,C20,C24").Value = "0"
    Range("C13").Value = "=IF($B$2=""Arkansas"",'Taxes & Fees'!$F$29,IF($B$2=""Connecticut"",IF($C$11<=50000,0.0635,0.07),IF($E21=TRUE,$F21,""Input Tax %""))"
    Range("C15").Value = "=IF($B$2=""California"",""Input CVR"",IF($E15=TRUE,$F15,""Input Fees""))"
    Rows("16:17").Select
    Selection.EntireRow.Hidden = True
    Range("C21").Value = "=IF($B$2=""Connecticut"",IF($C$11<=50000,0.0635,0.07),IF($E21=TRUE,$F21,""Input Tax %""))"
    Range("C23").Value = "=IF($B$2=""Arkansas"",'Taxes & Fees'!$F$29,IF($E23=TRUE,$F23,""Input Fees""))"

End Sub

However, if IF($B$2=""Arkansas"",'Taxes & Fees'!$F$29, is removed from Range("C13")... the code works. What I need help understanding is why I run into an error on C13 but not on C23?

Thanks

1 Answer 1

1

Add another ) to the end of the formula

Range("C13").Value = "=IF($B$2="Arkansas",'Taxes & Fees'!$F$29,IF($B$2="Connecticut",IF($C$11<=50000,0.0635,0.07),IF($E21=TRUE,$F21,"Input Tax %")))"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.