Hi Pros,

I have written the below code (part of much longer macro) several months ago and used it many time in Excel 2013. However, I now need to run this code on a PC that is running Office 365 and I get a compile error at line 3. Does anyone have any ideas please??


For k = 1 To N
Rows(ActiveCell.Row).Offset(1).Select
Selection.Insert Shift:=x1Down, CopyOrigin:=xlFormatFromLeftOrAbove
J = J + 1
ActiveCell.Offset(0, 4).Select

ActiveCell.Formula = "=INDEX('[Website Item Data File.xlsx]PIVOT2'!$B:$B,Offset(" & ActiveCell.Address & "," & (-k) & ",12)+" & (4 + k) & ")"
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "=INDEX('[Website Item Data File.xlsx]PIVOT2'!$C:$C,Offset(" & ActiveCell.Address & "," & (-k) & ",11)+" & (4 + k) & ")"

Next k