如何在excel vba中为vlookup函数提供单元格的地址?

时间:2018-06-11 13:54:37

标签: excel-vba vlookup vba excel

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

0 个答案:

没有答案