[英]VBA Vlookup formula, value does not appear in cell
My problem is that when i put this code in VBA: 我的问题是,当我将此代码放入VBA时:
Sub formula_vlookup()
'MONTHS
ActiveSheet.Cells(ActiveCell.Row, 1).Select
ActiveCell.Offset(0, 16).Select
With ActiveCell
.formula = "=IF(ISNA(VLOOKUP(" & .Offset(0, -16).Address(0, 1) & ",'CZ support'!$A:$AA,2,0)), _
"""",(VLOOKUP(" & .Offset(0, -16).Address(0, 1) & ",'CZ support'!$A:$AA,2,0)))"
End With
End Sub
It works perfectly ( i mean , it gives me the value of the cell that is "vlooked up" but the problem is that it does not display that value in the cell, so the only way to know if its a value there is making a SUM of the cells that contain this formula. 它可以完美地工作(我的意思是,它给了我“ vlooked”单元格的值,但问题是它没有在单元格中显示该值,因此唯一的方法就是知道它的值是否在包含此公式的单元格的总和。
how can i manage this problem? 我该如何解决这个问题? Thank you in advance for your help
预先感谢您的帮助
Things to check: 检查事项:
.Offset(...)
expanded to actual cell addresses) directly in worksheet cell(s) .Offset(...)
扩展为实际单元格地址) =IF(...)
by some text (eg "not found") to see if you're caught by an exception =IF(...)
的FALSE部分中的“”,以查看是否被异常捕获
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.