I am trying to use the .replace function to create a longer than 255 character vba formula. I am having issues with the replace portion not working. Would anyone be able to quickly look to see what I am doing wrong?
Code:
Sub Macro8()
'
' Macro8 Macro
'
'
Dim F1P1 As String
Dim F1P2 As String
Dim F1P3 As String
F1P1 = "=IF(OR(EOMONTH(Current_Month_End,0)<EOMONTH(INDIRECT(""'""&R40C&""'!Termination_Extension_Date""),0),INDIRECT(""'""&R40C&""'!Termination_Extension_Date"")=0),YYYY,0)"
F1P2 = """INDEX(INDIRECT(""'""&R[-9]C&""'!$A$29:$K$1098""),MATCH(1,IF(INDIRECT(""'""&R[-9]C&""'!$f$29:$f$1098"")<>"""",1,FALSE),0),6)"""
With ThisWorkbook.Sheets("Summary Workpaper").Range("C48")
.FormulaArray = F1P1
.Range("C48").Replace What:=F1P2, Replacement:=F1P2, LookAt:=xlPart
End With
End Sub