conditional cell.value statement

M

M John

I'm running out of ideas for the following situation:

If Cell.Value >0 and Cell.Value <=0.2 then
(code)

Else If Cell.Value >0.2 and Cell.Value <=.4
(other code)

Else If Cell.Value >0.4 and Cell.Value <=.6
(other code)

Else If Cell.Value >0.6 and Cell.Value <=.8
(other code)

Else Cell.Value >0.8 and Cell.Value <=1
(other code)

End If

Is there an easier way to do this? Am I missing something obvious? Right
now, I can't figure out how to make this scheme work.

Any pointers you can give me will be gratefully received.
Thanks,
MJohn
 
J

Jim Thomlinson

What you have is not to bad, but if you wnat to you could ucse a select case
statement instead. Something like

Select Cell.Value
Case < 0
'Some code (or not)
Case <= 0.2
'More Code
Case <= 0.4
'Yet more code still
Case Else
'Did not find it code
End Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top