Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default conditional cell.value statement

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default conditional cell.value statement

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
--
HTH...

Jim Thomlinson


"M John" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default conditional cell.value statement

Excellent work. Many thanks and much admiration.

MJohn

"Jim Thomlinson" wrote:

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
--
HTH...

Jim Thomlinson


"M John" wrote:

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

Reply
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
Cell Formatting of a Conditional Statement RobFJ[_4_] Excel Worksheet Functions 3 April 27th 10 10:44 AM
conditional statement using validation cell kfarley537 Excel Worksheet Functions 2 December 6th 07 11:34 PM
Need conditional statement to paint a cell Jim Thomlinson Excel Discussion (Misc queries) 0 May 31st 06 03:44 PM
Need conditional statement to paint a cell Jim Thomlinson Excel Worksheet Functions 0 May 31st 06 03:44 PM
formating a cell with a conditional if statement Rich[_11_] Excel Programming 1 July 14th 03 09:00 PM


All times are GMT +1. The time now is 09:41 AM.

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

About Us

"It's about Microsoft Excel"