dancushing
New Member
- Joined
- Dec 28, 2005
- Messages
- 3
I am trying to add this formula to my worksheet using VBA.
=IF(E5<=0,"",(E4/E5)*100)
I tried to use this line to do this.
Range("E6").Formula = "=IF(E5<=0,"",(E4/E5)*100)"
I get a 1004 error when I try to run this and I think it has something to do with the quotation marks in the middle of the statement.
I am using this formula in this cell because this cell is part of another formula that computes an average. If there is a #Div/0! then my other formula doesn't work right.
Is there any way to enter this formula using VBA?
=IF(E5<=0,"",(E4/E5)*100)
I tried to use this line to do this.
Range("E6").Formula = "=IF(E5<=0,"",(E4/E5)*100)"
I get a 1004 error when I try to run this and I think it has something to do with the quotation marks in the middle of the statement.
I am using this formula in this cell because this cell is part of another formula that computes an average. If there is a #Div/0! then my other formula doesn't work right.
Is there any way to enter this formula using VBA?