PDA

View Full Version : [SLEEPER:] Case issue



ksilenio
12-23-2019, 03:44 PM
Hi to everyone .First i'd like to wish you Merry Christmas and a Happy New Year.
Now the issue is. I have this case statement


Select Case CDbl(label.Caption)
the "label.caption" is a number
' now how can i get the range between two numbers . I mean
Select Case CDbl(label.Caption)
case >=450 and <=460
code....
case >=470 and <=480
code ....
' and so on...
How can i syntax this?
Regards

Paul_Hossler
12-23-2019, 03:50 PM
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/select-case-statement?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev11.query%3Fap pId%3DDev11IDEF1%26l%3Den-US%26k%3Dk(vblr6.chm1008810)%3Bk(TargetFrameworkMoniker-Office.Version%3Dv16)%26rd%3Dtrue%26f%3D255%26MSPPError%3D-2147217396






Case 450 To 460

......

Case 470 To 480


......




Other ways in the link

ksilenio
12-23-2019, 04:06 PM
Hi Paul Thank you for your help Regards

snb
12-24-2019, 03:07 AM
You don't need case select



choose((CDbl(label.Caption)-440)\10,"a","bb","ccc","ddddd")

ksilenio
12-24-2019, 10:07 AM
Hi Thank you for your reply snb