+ Reply to Thread
Results 1 to 9 of 9

How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Question How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    Dear Sirs,
    I am running this easy macro, see below. My problem is that it only works if the sheet (tabs) are called 1, 2, 3, 4,...etc. The users of the spreadsheet often change the TAB sheets so I would like the macro to refer to the actual (NAME) of the sheet, the one that you find first under the PROPERTIES section of the Microsoft Visual Basic Editor. Could anyone help?

    Kind regards
    Creare


    Please Login or Register  to view this content.
    Last edited by Fotis1991; 09-11-2013 at 04:15 AM. Reason: add code tags as for OP is his(her) first post!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    Welcome to the forum

    Pls take a few minutes to read forum rules, because:

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    This time i'll do for you. I am waiting to do it yourself next time.

    Thank you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    assuming the tags will appear ;-)

    Please Login or Register  to view this content.
    where Sheet1 is the codename
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    09-11-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    My apologies Fotis1991.
    Thank you for your comment.
    Last edited by Creare; 09-11-2013 at 04:45 AM.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    Thanks for undrstanding! Does the suggestion by JosephP worked for you?

  6. #6
    Registered User
    Join Date
    09-11-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    Hi Joseph,
    Thanks so much for your prompt assistance. It worked perfectly.
    Regards,
    Creare

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    you're welcome :-)

    please don't forget to mark the thread solved (click the 'thread tools' link at the top, then 'mark solved')

  8. #8
    Registered User
    Join Date
    09-11-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    No, thank you.
    Joseph's suggestion worked like a dream. Im stoked.
    cheers

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to refer to the (NAME) of the Sheet rather than the Name of the sheet in my macro

    Thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Replies: 7
    Last Post: 12-16-2012, 04:24 PM
  2. Replies: 2
    Last Post: 08-21-2012, 09:15 AM
  3. Refer to a hidden sheet using a macro.
    By fullers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 10:35 AM
  4. [SOLVED] Refer new sheet to previous sheet
    By Spot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-09-2005, 09:05 AM
  5. Have macro refer to formerly active sheet
    By chaminod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2005, 06:11 PM

Tags for this Thread

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