Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Darcy Jones   on Mar 11 In MS Office Category.

  
Question Answered By: Madeeha Malik   on Mar 11

Not sure what you're trying to do .. I'm not aware that sheets  have a
"codename" ... but....

.. You seem to be trying to second guess a user  that can alter a workbook.
Trust me... It's not possible.

Given that...

Assuming that the number of worksheets  isn't going to alter, you can
reference a sheet number in the sheets collection.

Instead of using a literal... "volvo", "dodge", "honda" ... You can use a
number. I'm unsure if this number changes if you just add sheets but I know
it changes if you delete sheets above that number. Say you had a sheet
"volvo" and you referenced it as sheet number 4. If you deleted a sheet
below 4 then this would change it's number. I'm not sure what to. I
personally don't see a *totally* foolproof way around this. Maybe more
knowledgable people will jump in.

I think I'd go for a cell in an unused space with a white font colour so
that the text in it couldn't be seen and loop through the sheets looking at
that cell and testing for its value with a select  case statement. This would
effectively create a "code" for that sheet to test for ... *But* .. the user
could still dump over that cell and then all bets are off.

Share: 

 

This Question has 13 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How to select specified worksheets by codename Or get search suggestion and latest updates.


Tagged: