+ Reply to Thread
Results 1 to 8 of 8

Need to create a Macro which convert the values in a column to Hyperlink.

  1. #1
    Registered User
    Join Date
    02-12-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Need to create a Macro which convert the values in a column to Hyperlink.

    Need to create a Macro which convert the values in a column to Hyperlink.


    When I am running the recorded macro it is always assigning the same link to all the hyperlinks.

    I want when I click on 'A' it should open Sheet with the name specified in the column 'D'.
    ex.
    Click on A should open sheet 'AA'
    Click on B should open sheet 'BB' and so on.

    Please refer to the attached sheet.Book2.xlsm

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    You can put this formula in A2:

    =HYPERLINK("#"&D2&"!A1",D2)

    and copy it down. Clicking on the cell will take you to cell A1 of the appropriate sheet.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-18-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    If we click the link by the use of =HYPERLINK("#"&D2&"!A1",D2) formula "Reference text is not valid" error message displayed..

    Thanks,
    Deepan

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    I've attached a copy of your file in which I have done this for you.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-12-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    Hi Pete,

    When I tried to use the same formula for other values I am getting error message saying "Reference not valid."

    Can you please check the attached sheet.ef50_hyperlinks.xlsm


    Thanks

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    Because you have hyphens in the sheet names, you need to put apostophes within the formula. Amend the formula in A2 to this:

    =HYPERLINK("#'"&D2&"'!A1",D2)

    and then copy down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    02-12-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    Yes, It works. Thanks a lot

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Need to create a Macro which convert the values in a column to Hyperlink.

    Okay, glad to hear that. If you are happy that your question has been answered, please mark the thread as Solved.

    Pete

+ 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