Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to evaluate dates | Excel Worksheet Functions | |||
Might be a bug in Evaluate Formula? | Excel Discussion (Misc queries) | |||
What is evaluate formula? | Excel Worksheet Functions | |||
Formula Will Not Evaluate | Excel Worksheet Functions | |||
Evaluate formula using VBA | Excel Discussion (Misc queries) |