Home All Groups Group Topic Archive Search About
Author
3 Sep 2010 3:24 AM
Sabbir Ahmad
Dim a As Double
Dim b As Double
Dim c As Double

a = 36.8
b = 44

select case a
case 36.6 to 37
MsgBox "???"

    Select Case b


    Case 42 To 43

    c = 26
    MsgBox "hmm"'<<<<< this shud be shown as this is the point but it
isnt giving me this msgbox :S :S

    Case 44 To 45
    c = 26.5

    Case Else
    End Select

End Select


what am i doing wrong?

Author
3 Sep 2010 3:57 AM
Mike S
On 9/2/2010 8:24 PM, Sabbir Ahmad wrote:
Show quoteHide quote
> Dim a As Double
> Dim b As Double
> Dim c As Double
> a = 36.8
> b = 44
> select case a
> case 36.6 to 37
> MsgBox "???"
>      Select Case b
>      Case 42 To 43
>      c = 26
>      MsgBox "hmm"'<<<<<  this shud be shown as this is the point but it
> isnt giving me this msgbox :S :S
>      Case 44 To 45
>      c = 26.5
>      Case Else
>      End Select
> End Select
> what am i doing wrong?

What happens when you run this?

Private Sub Command1_Click()
     Dim a As Double, b As Double, c As Double
     a = 36.8
     b = 44
     Select Case a
         Case 36.6 To 37
             Debug.Print "a : in range 36.6 to 37"
         Case Else
             Debug.Print "a : not in range 36.6 to 37"
     End Select
     Select Case b
         Case 42 To 43
             Debug.Print "b : in range 42 To 43"
             c = 26
         Case 44 To 45
             Debug.Print "b : in range 44 To 45"
             c = 26.5
         Case Else
             Debug.Print "b : not in range 42 to 43, 44 To 45"
     End Select
     Debug.Print "c : " & c
End Sub
Author
3 Sep 2010 4:41 AM
Larry Serflaten
"Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote
> a = 36.8
> b = 44

Try

b = 43


LFS
Author
3 Sep 2010 12:38 PM
Mayayana
Your message box is called in a Case where
a is 36.6 to 37 and b is 42 or 43. But you have
b as 44. It's just a simple oversight.


Show quoteHide quote
| Dim a As Double
| Dim b As Double
| Dim c As Double
|
| a = 36.8
| b = 44
|
| select case a
| case 36.6 to 37
| MsgBox "???"
|
|    Select Case b
|
|
|    Case 42 To 43
|
|    c = 26
|    MsgBox "hmm"'<<<<< this shud be shown as this is the point but it
| isnt giving me this msgbox :S :S
|
|    Case 44 To 45
|    c = 26.5
|
|    Case Else
|    End Select
|
| End Select
|
|
| what am i doing wrong?
Author
3 Sep 2010 2:24 PM
Jeff Johnson
"Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote in message
news:b4cd13a5-bee8-43e0-bd4f-40518d3e0e87@e14g2000yqe.googlegroups.com...

> what am i doing wrong?

Thinking that 44 is between 42 and 43....
Author
3 Sep 2010 2:37 PM
Bob Butler
"Jeff Johnson" <i.get@enough.spam> wrote in message
news:i5r0eo$ctn$1@news.eternal-september.org...
> "Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote in message
> news:b4cd13a5-bee8-43e0-bd4f-40518d3e0e87@e14g2000yqe.googlegroups.com...
>
>> what am i doing wrong?
>
> Thinking that 44 is between 42 and 43....

Well,for extremely small values of 44...

http://www.zazzle.com/2_2_5_tshirt-235465381553974025