Can anyone help me to perform Vlookup functionality by accepting the range using inputbox. For example, i have 2 columns column A and Column B as mentioned below:
Column A Column B
1 4
2 5
3 1
4 3
5 10
6 9
I want to select the range via inputbox and vlookup the values in Column B with values in Column A or vice versa and find out the difference. Or is there any better way to achieve the same? The following is a simple macro generated with Range hardcoded.
Sub Vlookup_func()
Range("C2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],R2C[-2]:R6C[-2],1,FALSE)"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C6")
Range("C2:C6").Select
End Sub
Bookmarks