sub function1()
Do While cells(i,4)<>"" 'Loop till value exists in column
if cells(i,2)>0 Then ' If we have a positive value
cells(i,5).formula="=vlookup(cells(i,3).address(0,0),table,2,true)' Adding context
end if ' Lookup the required column value
i=i+1
Loop 'Try to give address of a cell into vlookup