View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Greg Glynn Greg Glynn is offline
external usenet poster
 
Posts: 137
Default if statement conditions

I'd take the quotes out, because you're mixing data types. You need
to be testing for a numeric, not a string which may mean you need to

fico = val(cell.offset(0,3))

I'd also consider using SELECT CASE instead of the multi-level IF
structure

SELECT CASE fico

Case 0 to 149
PSICounts(0) = PSICounts(0) + 1

Case 150 to 199
PSICounts(1) = PSICounts(1) + 1

Case 200 to 259
PSICounts(2) = PSICounts(2) + 1

Case " 260"
PSICounts(12) = PSICounts(12) + 1

End Select