Syntax to match sheet by codename
Sometimes I use parens just out of habit- when I have more complicated logic,
it helps me keep track, but certainly not necessary here.
I need to refence by codename, not sheetname- my users may change the
sheetname so I don't want to hardcode those into my VBA. That put me on the
right track though- "sht.codename" does what I was looking for.
Thank you,
Keith
"tompl" wrote:
I would dump the three variables you set up as they are redundant and use
this language:
If sht.Name = "Sheet2" Or sht.Name = "Sheet4" or sht.Name = €śSheet17€ť Then
I have not seen the use of parenthesis where you have them.
Tom
|