Hello I am using the following code but I keep getting an error message and cant figure out what is wrong:
Sub InsertFormula5()
With Sheets("File 1 D").Select
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("P2").Formula = "=IF($H2="INTERNAL FA","Financial Advisors",IF($H2="PRIMARY CONTACT","All Sections",IF($H2="EXTERNAL FA","Allocated Sections")))"
Range("P2").Copy
Range("P3:P" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End With
Range("P2").Select
End Sub
The Error Message that pops up says:
Compile Error
Expected: End of Statement
The formula field is the one that is highlighted.
Does anybody have any idea of what I might be doing wrong?
Thanks
Bookmarks