TheJoelteon
New Member
- Joined
- Aug 17, 2016
- Messages
- 10
Hi everyone,
Ive been having some trouble with an array formula that's over 255 characters, and ive been trying to split it up into sub/dummy functions, but it doesnt seem to be working. Can someone please take a look at my code and see if you spot anything?
Right now the debug is having issues with the .FormulaArray = Formula_Full part, giving me error "unable to set the formulaarray property of the range class."
Thoughts?
Ive been having some trouble with an array formula that's over 255 characters, and ive been trying to split it up into sub/dummy functions, but it doesnt seem to be working. Can someone please take a look at my code and see if you spot anything?
Code:
Sub LongArray_ProvincialCalcs()
Dim Formula_Full As String
Dim Formula_Get_ARHCA As String
Dim Formula_Apply_ARHCA As String
Dim Formula_Get_KEYWORD As String
Formula_Full = "=IFERROR(H6*(IFERROR(IF(Get_ARHCA, Get_KEYWORD, Apply_ARHCA))))"
Formula_Get_ARHCA = "IF(ISNUMBER(VALUE(LEFT(L6,1)))=TRUE,VLOOKUP(MID(L6,FIND("" "",L6)+1,10),RATES,2)"
Formula_Apply_ARHCA = "H6*Keywords!$B$6"
Formula_Get_KEYWORD = "VLOOKUP((INDEX(KEYWORDS, MATCH(1, COUNTIF(L6, ""*"" & KEYWORDS & ""*""), 0))), RATES, 2, FALSE)), "" ""))"
With Worksheets("Draft_Version").Range("I5")
.FormulaArray = Formula_Full
.Replace Get_ARHCA, Formula_Get_ARHCA
.Replace Get_KEYWORD, Formula_Get_KEYWORD
.Replace Apply_ARHCA, Formula_Apply_ARHCA
End With
End Sub
Right now the debug is having issues with the .FormulaArray = Formula_Full part, giving me error "unable to set the formulaarray property of the range class."
Thoughts?