+ Reply to Thread
Results 1 to 4 of 4

problems with hyperlinks linking to other worksheets

  1. #1
    Registered User
    Join Date
    08-03-2009
    Location
    London, UK
    MS-Off Ver
    Excel Mac 2008 & Excel 2003
    Posts
    7

    problems with hyperlinks linking to other worksheets

    I have managed to find some code which, upon pressing a command button on the 1st worksheet in my workbook it:

    1. populates a list of the names of all the other sheets in the document
    2. converts each name into a hyperlink that when clicked, opens the sheet. (or at least it should)
    3. Add the word 'menu' in cell A1 of each sheet that is a hyperlink back to the menu sheet

    There are around 40 sheets in the document so you can see why this is easier than scrolling along the bottom to find the correct one. Or it should be.!

    At the moment. The list populates correctly but when i click any of the hyperlinks in the list that are more than 1 word or have a space it brings an error message "reference is not valid"

    (in reference to point 3 above, the menu link on each of the other sheets works fine)

    I can fix the error by manually editing each hyperlink but, when I add a new sheet by clicking the button, it then reverts back to the error.

    I have attached a copy of the workbook to take a look at and would very much appreciate some help or an idea of where else I can find it. (FYI there is no data on any of the sheets and i have changed the names of the sheets due to data sensitivity issues)

    Many thanks

    Attached Files Attached Files
    Last edited by Mostlygood; 11-27-2009 at 09:40 AM.

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: problems with hyperlinks linking to other worksheets

    Hi

    If there is a space in a sheet name you need the name to have single quotes in order to work.

    Change the line of code in your workbook that starts with sname to

    Please Login or Register  to view this content.
    this adds the single quotes and it works okay.

    regards

    Jeff

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: problems with hyperlinks linking to other worksheets

    There are only 37 Worksheets in your example, Column A needs to be cleared before you run the rest of the code.

  4. #4
    Registered User
    Join Date
    08-03-2009
    Location
    London, UK
    MS-Off Ver
    Excel Mac 2008 & Excel 2003
    Posts
    7

    Re: problems with hyperlinks linking to other worksheets

    Thankyou Jeff

    That solved the problem

    DAN

+ 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