Hi having problems with this macro
At the moment it is copying down the formula to cell G5000 but this is a variable sometimes it can be G2000 sometime G10000,
Can someone show me how to edit this so no matter what it pastes down to the last cell of data
Thanks in advance
Sub VlookupRM()
'
' VlookupRM Macro
'
'
Range("G2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'[All Engineers.xls]Eng List'!C1:C4,3,FALSE)"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G5000")
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-3],'[All Engineers.xls]Eng List'!C1:C4,4,FALSE)"
Range("H2").Select
Selection.AutoFill Destination:=Range("H:H")
Range("H:H").Select
ChDir _
"G:\Stats"
End Sub
At the moment it is copying down the formula to cell G5000 but this is a variable sometimes it can be G2000 sometime G10000,
Can someone show me how to edit this so no matter what it pastes down to the last cell of data
Thanks in advance
Sub VlookupRM()
'
' VlookupRM Macro
'
'
Range("G2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'[All Engineers.xls]Eng List'!C1:C4,3,FALSE)"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G5000")
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-3],'[All Engineers.xls]Eng List'!C1:C4,4,FALSE)"
Range("H2").Select
Selection.AutoFill Destination:=Range("H:H")
Range("H:H").Select
ChDir _
"G:\Stats"
End Sub