简体   繁体   English

Vlookup计数器值的范围

[英]Vlookup Range of a counter Value

I'm trying to do a Vlookup an the defined range is the counter value of the For: 我试图做一个Vlookup,定义的范围是For的计数器值:

For N2 = 4 To ThisWorkbook.Worksheets.Count
Range("B3").End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Formula = "=VLOOKUP($B5,'[" & N2 & "]'!$B$4:$AH$35,MATCH(C$3,'[" & N2 & "]'!$B$3:$AH$3,0),FALSE)"
Next N2

But the '[" & N & "]' asks me to open the "3" file but I want to do the vlookup in the Worksheet number 3 但是'[“&N&”]'要求我打开“ 3”文件,但是我想在工作表编号3中进行vlookup

Could you please help me to correct that part? 你能帮我纠正那部分吗?

Thanks 谢谢

For N2 = 4 To ThisWorkbook.Worksheets.Count
Range("B3").End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Formula = "=VLOOKUP($B5,'Sheet" & N2 & "'!$B$4:$AH$35,MATCH(C$3,'Sheet" & N2 & "'!$B$3:$AH$3,0),FALSE)"
Next N2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM