Excel tab sheet names vs. Visual Basic sheet names

Posted by SteveNeedsSheetNames on Stack Overflow See other posts from Stack Overflow or by SteveNeedsSheetNames
Published on 2010-04-16T00:20:01Z Indexed on 2010/04/16 0:23 UTC
Read the original article Hit count: 594

Filed under:
|
|

It seems that Visual Basic can not reference sheets according to user-modified sheet names. The worksheet tabs can have their names changed, but it seems that Visual Basic still thinks of the worksheet names as Sheet1, etc., despite the workbook tab having been changed to something useful. I have this: TABname = rng.Worksheet.Name ' Excel sheet TAB name, not VSB Sheetx name. Thanks, Bill Gates. but I would like to use sheet names in Visual Basic routines. The best I could come up so far is to Select Case the Worksheet Tab vs. Visual Basic names, which doesn't make my day. Visual Basic must know the Sheet1, Sheet2, etc., names. How can I get these associated with the Excel tab names so that I don't have to maintain a look-up table which changes with each new sheet or sheet tab re-naming? Thanks in advance for your replies.

© Stack Overflow or respective owner

Related posts about excel

Related posts about visual