Basically, if you're only comparing one variable use...
When you need to compare ranges of a variable or multiple variables use...
Basically the If..Then..Else approach is what the Select True construct is converted to into machine code. You could still use Select True, but it's down to personal preference.
The argument about the first, normal, use of Select is that the value of the variable being compared need only be loaded into a register once (in machine code). The compare statements then only need to load the values that this first one is being compared to. Make sense? Basically, the theory is that it made the Select statement just that little bit faster then the If..Then version. I remember the thread, but can't remember the outcome.
Basically just use whichever you find more readable, as the speed gain, if any, is probably so small it doesn't matter.
Select <variable> Case blah ... Case blah 2 ... Default ... End Select
When you need to compare ranges of a variable or multiple variables use...
If <conidtion(s)> Then ... ElseIf <condition(s) 2> Then ... Else ... ; <<< if nothing above is met EndIf
Basically the If..Then..Else approach is what the Select True construct is converted to into machine code. You could still use Select True, but it's down to personal preference.
The argument about the first, normal, use of Select is that the value of the variable being compared need only be loaded into a register once (in machine code). The compare statements then only need to load the values that this first one is being compared to. Make sense? Basically, the theory is that it made the Select statement just that little bit faster then the If..Then version. I remember the thread, but can't remember the outcome.
Basically just use whichever you find more readable, as the speed gain, if any, is probably so small it doesn't matter.