Im new to vba excel macro. usually in excel i will double click on the cell and then the data will auto generate till the last row. but in vba how to make it ? Below is my code. currently im selecting BF2 to vlookup. after i get the value of vlookup. i want to populate the data till the last row. usually in excel way, i will just double click on the cell and then it will populate. so how do we do in vba macro ? advise pls.
Set myValues = Application.InputBox("Please select on the CON2:",
Default:=Range("BE2").Address(0, 0), Type:=8)
Set myResults = Application.InputBox("Please select previous CON2 to VLOOKUP:", Type:=8)
On Error Resume Next
Set myValues = myValues.Offset
FirstRow = myValues.Row
FinalRow = Cells(65536, myResults.Column).End(xlUp).Row
Range("BF2").Formula = _
"=VLOOKUP(" & Cells(FirstRow, myValues.Column).Address(False, False) & ", " & _
" " & myResults.Address(External:=True) & " , 1, 0)"