在VBA中使用IF公式 [英] Using IF formula in VBA
本文介绍了在VBA中使用IF公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想知道如何在VBA中使用IF公式.这是我目前拥有的公式,但是它给了我错误..语句结尾"
I was just wondering how I could use an IF formula in VBA. This is the formula that I currently have, but it is giving me the error.."End of Statement"
Range("a10").Select
Selection.End(xlDown).Select
lastrow = ActiveCell.Row
For i = 10 To lastrow
Sheets("20140618 Loans").Range("Z" & i).Formula = _
"=IF(ABS("Y" & i)>400,""CHECK"","""")"
有什么想法吗?谢谢.
推荐答案
所以您需要这样做:
Sheets("20140618 Loans").Range("Z" & i).Formula = _
"=IF(ABS(Y" & i & ")>400,""CHECK"","""")"
这篇关于在VBA中使用IF公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文