+ Reply to Thread
Results 1 to 5 of 5

Macros for hyperlinks to similar values in a separate worksheet

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    10

    Macros for hyperlinks to similar values in a separate worksheet

    Hi all,

    I have been looking around for a set of macros code that suit my needs but to no avail. Please kindly render some assistance and thank you in advance!

    This is what I am trying to do. I have 2 worksheets in the same file, the sheet1 contains an overview list of all my clients(column C) and the sheet2 contains more details of each client which contains more details. I am trying to create a set of vba instruction that hyperlinks each specific value (client's name) in column C of sheet1 to a similar value (similar client's name) in column A of sheet2. The hyperlink command can't be attached to specific cell as more rows will be added as time goes hence it needs to be tag a specific values.

    Thank you again!

    Cheers!

  2. #2
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Macros for hyperlinks to similar values in a separate worksheet

    Hi,

    You need to loop through all the client names in sheet1, take the name of each client and use the find function to find their location on the second sheet. Then insert the hyperlink to point at this location. Best thing to do is use the macro recorder - this should be able to give you most of the code, you'll just have to add in the loop.

    Ant

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macros for hyperlinks to similar values in a separate worksheet

    Hi, I tried recording but it dosen't seem to work...

  4. #4
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Macros for hyperlinks to similar values in a separate worksheet

    What doesn't work?

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macros for hyperlinks to similar values in a separate worksheet

    recording dosen't work cause it only hyperlink one specific cell to the other. Could you kindly elaborate on looping the entire list? I am quite new to this..

  6. #6
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Macros for hyperlinks to similar values in a separate worksheet

    OK, in you code where it says activecell.hyperlinks.add you need to change activecell to sheet1.cells(x,3).hyperlinks.add then encapsulate the whole code in a loop e.g.
    For x = 1 to 100
    sheet1.cells(x,3).hyperlinks.add
    rest of code
    next x

    If you are struggling to follow you need top read up a bit on for next loops etc. The top thread in this message board has some learning materials.

    Ant

+ 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