This is my first time using the replace function in an attempt to bypass the 255 character limit within an array. For some reason the macro will put theFormulaPart1 in the code but then it says my formula contains an error and it does not replace the X_X_X with theFormulaPart2. This is also my first time utilizing one of these sites for help with vba so I am sorry in advance if my formatting is sloppy. Thanks for all your help!
Sub PortNum()
'
' PortNum Macro
'
'
Dim theFormulaPart1 As String
Dim theFormulaPart2 As String
theFormulaPart1 = "=INDEX('S:\CREDIT SHARED\Credit Files\2. C&I CREDIT FILES\~C&I Spreading Model Data\[C&I Portfolio Data.xlsx]Page1_1'!R7C3:R1000C3, X_X_X)"
theFormulaPart2 = "LARGE(IF(R346C11='S:\CREDIT SHARED\Credit Files\2. C&I CREDIT FILES\~C&I Spreading Model Data\[C&I Portfolio Data.xlsx]Page1_1'!R7C1:R1000C1, ROW(R7C1:R1000C1)-ROW(R7C1)+1), ROW(R[-346])))"
With ActiveSheet.Range("O347")
.FormulaArray = theFormulaPart1
.Replace "X_X_X)", theFormulaPart2
End With
Range("O347").Select
Selection.AutoFill Destination:=Range("O347:O359"), Type:=xlFillDefault
Range("O347:O359").Select
End Sub