+ Reply to Thread
Results 1 to 2 of 2

Code to reference sheet names based on index

  1. #1
    Registered User
    Join Date
    06-22-2015
    Location
    Wakarusa, Indiana
    MS-Off Ver
    2010
    Posts
    9

    Code to reference sheet names based on index

    Hey guys, I need some help on making a code that will allow me to store a worksheets name in a cell. However, the worksheets will continually be added so I need to generally reference them by their index. I was thinking something like this:

    Function SheetName(#)
    Sheet(#).Name = SheetName
    End Function

    This way I could put the function into a cell (put =SheetName(2) into a cell to have that cell be filled with the name of the second indexed sheet). However, I do not know the correct syntax as I am just beginning. Any help is greatly appreciated! Thanks!

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Code to reference sheet names based on index

    You are close to the solution
    Try
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code to select worksheets based on sheet names in a list
    By cdself in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2013, 01:00 PM
  2. Selecting Mulitple Sheets by their Code Index Names
    By Simon.Ward in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-31-2013, 06:00 AM
  3. Changing Sheet Names based on a Cell Reference
    By tjloggia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-04-2012, 04:35 PM
  4. Changing Sheet Names Based on # Values in Names
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2010, 03:34 PM
  5. [SOLVED] code to add a name to the names collection and assign a reference
    By keithb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2005, 02:05 AM

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