RE: How to use Select Case when several cases result in the same code?
- From: Lene Fredborg <lf@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 3 Mar 2007 14:32:00 -0800
Use a comma to separate the values instead of "Or":
Case "This", "That"
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
"Benjamino5" wrote:
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!
- Prev by Date: Q: SaveAs?
- Next by Date: Re: How do insert an automatic future date in Word?
- Previous by thread: Q: SaveAs?
- Next by thread: Re: VBA built-in object names auto-switching to lowercase--why?
- Index(es):
Relevant Pages
|
Loading