I am using a WorkSheet change event to run a couple of functions. So far I am having Range issues when inserting a formula array. Is there anything I missing in the code below?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("E4:E1100")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
Application.EnableEvents = False
Range("M4").Copy
Range("M5:M1100").PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("M5:M1100").Value = Range("M5:M1100").Value
Application.CutCopyMode = False
Range("O2:O10").FormulaArray = "=IF(Master_Sales_Order="""",0, IFERROR(INDEX(value_for_posting,MATCH(Master_Sales_Order,IF(ISNUMBER(SEARCH(""comp"",part_type)),customer_order,0),0)),""NO P/O""))"
Application.EnableEvents = True
End If
End Sub