从另一个vlookup中减去一个vlookup,并将结果分配到范围VBA
我正在尝试从另一个vlookup中减去一个vlookup,并将结果分配给我贬低的范围。我得到类型的不匹配。
dim wb as workbook
dim ws1_name as range
dim ws2_range as range
dim range as range
set wb = xxxxxxx
set ws1_name as .....
(all the ranges are set)
Dim x As Long
For x = 3 To lastr_ws1
range.Value = (Application.WorksheetFunction.VLookup(ws1_name, ws2_range, 27, False) - Application.WorksheetFunction.VLookup(ws1_name, ws2_range, 30, False))
Next
I'm trying to subtract one vlookup from another and assign the results to the range that I've decalred. I'm getting a type mismatch.
dim wb as workbook
dim ws1_name as range
dim ws2_range as range
dim range as range
set wb = xxxxxxx
set ws1_name as .....
(all the ranges are set)
Dim x As Long
For x = 3 To lastr_ws1
range.Value = (Application.WorksheetFunction.VLookup(ws1_name, ws2_range, 27, False) - Application.WorksheetFunction.VLookup(ws1_name, ws2_range, 30, False))
Next
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论