+ Reply to Thread
Results 1 to 3 of 3

Sheet properties Name and (Name)

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Sheet properties Name and (Name)

    When starting the Visual Basic editor three windows pop up: the editor, a kind of "project explorer" and a sheet properties.

    1) I am curious about this "sheet properties" window appearing with the editor. What is the purpose in a VBA programming situation?
    2) Two of the sheet properties are 'Name' and '(Name)' and both are by default designated 'Sheet1'. Apart from the fact that you can change 'Name' by clicking the tab of the sheet, what is the difference between the two properties?
    3) I have a workbook where I need an easy reference to each sheet, but they are all given an explanatory 'Name' that is both long and complicated and cannot be changed, so I hope to be able to use the other. Is it possible in formulas or VBA to refer to '(Name)' in stead of 'Name'?


    NSV

  2. #2
    Bob Phillips
    Guest

    Re: Sheet properties Name and (Name)


    "nsv" <[email protected]> wrote in message
    news:[email protected]...
    >
    > When starting the Visual Basic editor three windows pop up: the editor,
    > a kind of "project explorer" and a sheet properties.
    >
    > 1) I am curious about this "sheet properties" window appearing with the
    > editor. What is the purpose in a VBA programming situation?


    You can change the properties there, such as the name, the visible property.

    > 2) Two of the sheet properties are 'Name' and '(Name)' and both are by
    > default designated 'Sheet1'. Apart from the fact that you can change
    > 'Name' by clicking the tab of the sheet, what is the difference between
    > the two properties?


    Name is the value that you see in Excel, and can be changed here. (Name) is
    what is called the CodeName and cannot be changed from Excel. Because of
    this, worksheets are often addressed in VBA code by the codename, as you
    know the user will not change that whereas they might change the Name of the
    worksheet.

    > 3) I have a workbook where I need an easy reference to each sheet, but
    > they are all given an explanatory 'Name' that is both long and
    > complicated and cannot be changed, so I hope to be able to use the
    > other. Is it possible in formulas or VBA to refer to '(Name)' in stead
    > of 'Name'?


    As explained above yes. Instead of

    Worksheets("Sheet1").Select

    you use

    Sheet1.Seelect

    It is also good practice to give a meaningful codename to your worksheets,
    such as Master, Totals, or whatever. I also precede the codename with 'ws'
    as a quickly identifiable handle.



  3. #3
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349
    Thanks a lot - all seems logical and it is surely very useful.

    NSV

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1