Sub test1()
Dim rng As Range, cl As String, sh As String
On Error Resume Next
With Application
Set rng = .InputBox("Select range", "VLOOKUP", Default:=Selection.Address, Type:=8)
If rng Is Nothing Then Exit Sub
End With
cl = rng.Address
sh = rng.Worksheet.Name
Range("B2").Formula = "=VLOOKUP(A2," & "'" & sh & "'!" & cl & ",1,0)"
End Sub