Complete novice and am trying to get the below code working:
Sub GVLOOKUP()
'
' VLOOKUP Macro
'
'
Cells.Select
Cells.EntireColumn.AutoFit
Range("E1").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "Description"
Range("E2").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.Formula2R1C1 = _
"=VLOOKUP(RC[-4]:R[10507]C[-4],Sheet3!R[-1]C[-4]:R[10636]C[-3],2,FALSE)"
Columns("E:E").EntireColumn.AutoFit
End Sub
Works fine on Excel 2016, but when I try and use in Excel 2010 I get the Run-time error 438.
Any ideas please?
Sub GVLOOKUP()
'
' VLOOKUP Macro
'
'
Cells.Select
Cells.EntireColumn.AutoFit
Range("E1").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "Description"
Range("E2").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.Formula2R1C1 = _
"=VLOOKUP(RC[-4]:R[10507]C[-4],Sheet3!R[-1]C[-4]:R[10636]C[-3],2,FALSE)"
Columns("E:E").EntireColumn.AutoFit
End Sub
Works fine on Excel 2016, but when I try and use in Excel 2010 I get the Run-time error 438.
Any ideas please?