1
我想改变vlookup的列索引号,但是在我看到的单元格中显示Colnum-14
。Vlookup可变列索引号
有什么我错过了吗?我知道match/index
公式,但我必须使用vlookup
。
我的代码:
Dim Colnum As Integer
For Colnum = 15 To 16
Sheets("Sheet1").Cells(8, Colnum + 1).Formula = "=iferror(vlookup(" & Sheets("Sheet1").Cells(8, 3).Address(False, True) & ",'Sheet2'!" & Range(Cells(3, 2), Cells(20, 10)).Address & "," & "Colnum-14" & ",False), ""NA"")"
Next Colnum
更改' “Colnum-14”'只'Colnum':'范围(将细胞(3,2),将细胞(20,10))地址& “” &“Colnum。 -14“&”'。 – Manhattan
@TheLaughingMan当我接到一个电话时,我发布了下面的答案 - 所以我错过了你的评论 – brettdj
@TheLaughingMan感谢您的帮助!:) – user1204868