如何使用“此行"在VBA VLOOKUP中? [英] How to use "This Row" in VBA VLOOKUP?
问题描述
我正在尝试修改Vlookup函数,以使其使用此行"功能.例如,我有一个宏,将以下公式放在B列中:
I am trying to modify a Vlookup function so that it uses "this row" functionality. For example I have a macro that places in Column B the Following formula:
= VLOOKUP(I1253,treatlookup,11,FALSE)
=VLOOKUP(I1253,treatlookup,11,FALSE)
这很好用,但是在宏过程中,我需要将其切换到另一个公式:
This works well, however during the macro, I need to have it switch over to another formula:
= VLOOKUP(I1253,Itemlookup,22,FALSE)
=VLOOKUP(I1253,Itemlookup,22,FALSE)
当然,数据每次都会变化,所以我不能只将公式放在特定的单元格中.所以我想要公式说明的是
Of course the data varies everytime so I can not just have that formula put in at a specific cell. So what I would like the formula to state is
= Vlookup(I"CurrentRow",ItemLookup,22,False)
= Vlookup(I"CurrentRow", ItemLookup, 22,False)
然后我可以使用if语句来确定要使用两个公式中的哪个.
I can then use an if statement to determine which of the two formulas to use.
感谢提前使用Excel 2010.
thanks in Advance Using Excel 2010.
推荐答案
使用
这篇关于如何使用“此行"在VBA VLOOKUP中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!