View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bishop Bishop is offline
external usenet poster
 
Posts: 208
Default Capturing "text" instead of the formula

I have the following code snippet:

Pass = 0
Fail = 0
For i = 9 To (ZeroRow - 3) Step 8
If Cells(i, "H").Value = Pass Then
Pass = Pass + 1
Else
Fail = Fail + 1
End If
Next

The cells I'm referring to actually have formulas in them but when you look
at the worksheet the cells have either "Pass" or "Fail" in them. That's what
I'm trying to capture. But when I run this code it doesn't see "Pass" in any
of the cells so all of them in the for loop get assigned to Fail. I've tried
putting the word Pass in quotes:

If Cells(i, "H").Value = "Pass" Then

but that doesn't work either. How can I fix this?