+ Reply to Thread
Results 1 to 5 of 5

Sequential Hyperlinking

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Sequential Hyperlinking

    Hey there--

    So I have a main spreadsheet with names that pull data from 400 individual worksheets that are named numerically. Is there an easy way to macro hyperlinks? This is so when other users view the main spreadsheet they can click on the name and open up the individual sheet.

    Example: in the B column, starting with B3, I have Jon Smith, who is linked to http://intranet/server/card 1.xls, then in B4 I have Jane Doe who is linked to http://intranet/server/card 2.xls, and so on and so forth all the way till "card 400.xls"

    Thanks in advance for anyone's help!

  2. #2
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: Sequential Hyperlinking

    Put this code in a module and try it. Does it work?.

    Function FindLastRow(col As Byte, Optional ws)
        If IsMissing(ws) Then
            Set ws = ActiveSheet
        End If
        FindLastRow = ws.Cells(Rows.Count, col).End(xlUp).Row
    End Function
    
    Public Sub Create_Hyperlink()
        Dim rCell, rng As Range
        Dim rw As Integer
        
        Set rng = Range("B3:B" & FindLastRow(2))
        
        For Each rCell In rng
            rw = rCell.Row
            Range("B" & rw).Select
            ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
                Address:="http://intranet/server/card " & rw - 2 & ".xls", _
                SubAddress:="", _
                ScreenTip:="Cards_" & rw - 2
        Next
    End Sub
    Elio fernandes

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sequential Hyperlinking

    Elio! Thank you very much!!!

    The FindLastRow function kept coming up with an error, but since I had a set number of rows I just replaced that fuction with setting rng = Range("B3:B403), and it did work!

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sequential Hyperlinking

    @ buggzero

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    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.

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sequential Hyperlinking

    Appreciate it. Did not know how to give thanks

+ 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