I am trying to insert a long formula array through VBA. however, Replace part of the code does not seem to work. Any ideas why? Thanks
[CODE][Sub Insert_All_Formulas()
Dim sht As Worksheet
Dim tbl As ListObject
Dim FindColumn As Integer
Dim rngData As Range
Dim x, y, z As String
Set sht = ThisWorkbook.Worksheets("INSERT_INITIAL_ASSET_LIST_HERE")
x = "CONCATENATE(RC[-3],RC[-2],RC[-1])"
y = "CONCATENATE(Table_Aggregated_ASSETLIST[[#All],[Description]],Table_Aggregated_ASSETLIST[[#All],[Manufacturer]],Table_Aggregated_ASSETLIST[[#All],[Model]])"
z = "Table_Aggregated_ASSETLIST[[#All],[PPM PRICE]]"
sht.Activate
sht.Range("F2").Select
Selection.FormulaArray = "=IFERROR(VLOOKUP(1111,CHOOSE({1,2},2222,3333),2,FALSE),""not found"")"
Selection.Replace What:="x", Replacement:=x
Selection.Replace What:="y", Replacement:=y
Selection.Replace What:="z", Replacement:=z
End Sub/CODE]
Bookmarks