Clayton, I am using a BCC to copy you directly, because I think that I really need to ask you about this. I am sending directly to the api list as a backup.

I do not want to complain too loudly, since I really like these Wiki pages, but...

I have seen errors in the documentation regarding the Case statement over the years. I think that some have been fixed (like in the help), but I found one on the Wiki today. I was making minor changes to the Wiki, but I really do not want to change this unless the Wiki is the master.

This incorrectly states :

Select Case Var
Case Var > 8 And Var < 11 ' ... Var is greater than 8 and less than 11

This is not correct. In fact, it is not even close. What it really does, is to evaluate (Var > 8 AND Var < 11), which returns a value of 0 (False) or -1 (True), and then compares Var to 0 or -1.

you can do something tricky like the following, but that is pretty slick, which makes me think that Bernard Marcelly came up with it, but I do not remember now:

Case Var XOR NOT(Var>8 AND Var< 11)

Better to use "To" if you can use equality rather than inequality.

Case 8 To 11

In my book, I have a creative IIF statement to deal with this as well.

Andrew Pitonyak
My Macro Document:
My Book:
See Also:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to