首页 > 解决方案 > 如何将单元格的地址提供给 excel vba 中的 vlookup 函数?

问题描述

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

标签: excelvlookupvba

解决方案


推荐阅读