I have a Select Case structure with six cases (six different values for the
variable I'm checking).
However, in three of the cases, I want to run the exact same lines of code.
How can I do this without copying and pasting the same chunk of code three
times over? If I write:
Case "This" Or "That"
VBA gives an error.
Is there another structure I should be using? A lot of If/Then statements
would be more cluttered than a Select Case, but maybe there's something else
I can use instead?
Thanks!
Lene Fredborg - 03 Mar 2007 22:32 GMT
Use a comma to separate the values instead of "Or":
Case "This", "That"

Signature
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
> I have a Select Case structure with six cases (six different values for the
> variable I'm checking).
[quoted text clipped - 13 lines]
>
> Thanks!
Benjamino5 - 03 Mar 2007 22:55 GMT
Benjamino5 - 03 Mar 2007 22:56 GMT