LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to Evaluate formula results in VBA

Hello,

I am trying to add VBA code in Excel to evaluate the results of a Formula in
a specific cell and then to use the result in an If statement.
The macro loops thru each row, and I want to compare the formula result in a
specific cell to see if the result is equal to 0. If the result is equal to 0
then I want to change the value of the cell to a text string.

Here is what I have so far.

Dim intRows As Integer
intRows = Range("C1").CurrentRegion.Rows.Count
'Loop through all rows
For i = 2 To intRows
If Application.Evaluate("AJ & i") = 0 Then
Range("AJ" & i).Value = "USED"
End If

Thanks in advance for your help.

Jeff
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to evaluate dates bigbird98 Excel Worksheet Functions 2 July 2nd 08 09:43 PM
Might be a bug in Evaluate Formula? cyx Excel Discussion (Misc queries) 2 May 2nd 07 10:52 PM
What is evaluate formula? Rasoul Khoshravan Excel Worksheet Functions 11 October 27th 06 01:52 PM
Formula Will Not Evaluate Cecil Excel Worksheet Functions 3 April 25th 06 07:38 PM
Evaluate formula using VBA Ali Baba Excel Discussion (Misc queries) 0 August 17th 05 12:31 AM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"