Hello,
I'm having some trouble with inserting a formula using VBA where the formula contains an asterisk (*).
My original working VBA code is this:
However, I needed to add a second criteria using * for AND. The following formula just adds *(ISBLANK(t_JohnDoe[Score])) which works with in cell testing:
Trying to use the following to insert this new formula keeps failing, and I suspect it's due to the * symbol.
Results in runtime error 1004 Application-defined or object-defined error
I've tried separating the asterisk to no avail:
Any help would be greatly appreciated…
I'm having some trouble with inserting a formula using VBA where the formula contains an asterisk (*).
My original working VBA code is this:
VBA Code:
'Insert Filter Formula
ws.Range("A3").Formula2 = "=LET(x,FILTER(CHOOSECOLS(t_" & Name & _
",13,1,2,20,21,9,10,16,18),COUNTIF(l_OnHand,t_" & _
Name & "[Book Status])),SORT(x,3))"
Excel Formula:
=LET(x,FILTER(CHOOSECOLS(t_JohnDoe,13,1,2,20,21,9,10,16,18),(COUNTIF(l_OnHand,t_JohnDoe[Book Status]))*(ISBLANK(t_JohnDoe[Score]))),SORT(x,3))
Results in runtime error 1004 Application-defined or object-defined error
VBA Code:
'Insert Filter Formula
ws.Range("A3").Formula2 = "=LET(x,FILTER(CHOOSECOLS(t_" & Name & ",13,1,2,20,21,9,10,16,18)," & _
"COUNTIF(l_OnHand,t_" & Name & "[Book Status]))*(ISBLANK(t_" & Name & "[Score]))),SORT(x,3))"
VBA Code:
& "*" &