+ Reply to Thread
Results 1 to 4 of 4

Hyperlink Creation

Hybrid View

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    South Africa
    Posts
    9

    Hyperlink Creation

    Hi guys,

    New to the forum.

    Hoping you guys can help, i have searched the forum already but none of the solutions make sense to me.

    I have attached a sample file along with an explanation of my problem:

    So here goes, each cell needs to have a hyperlink to the same directory but the file name is dynamic. Is there any way to do this quicker instead of doing linking each cell?
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    Try this coded solution,

    Place the code in a standard code module.

    Sub Macro1()
    '
        Dim rngCell As Range
        Dim strPath As String
        
        strPath = "C:\Documents and Settings\My Documents\"
    '
        For Each rngCell In Range("A1", Cells(Rows.Count, 1).End(xlUp)).Cells
            ActiveSheet.Hyperlinks.Add Anchor:=rngCell, Address:=strPath & rngCell.Value, _
                                       TextToDisplay:=rngCell.Value
        Next
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-16-2008
    Location
    South Africa
    Posts
    9

    Not working

    Hi Andy,

    Sorry, only got around to the solution now. Thanks for the response, it works in the sample problem sheet i attached, however when importing the module to another sheet(the original one), i get an error. Apparently the last two lines are invalid, but they work on the old sheet?

  4. #4
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    B1=C:\Documents and Settings\My Documents\
    C1=HYPERLINK(B1&A1,A1)
    COPY DOWN
    I need your support to add reputations if my solution works.


+ 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. Create a hyperlink based on a hyperlink
    By goofy78270 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2007, 03:59 PM
  2. Hyperlink to networked printer
    By hal9000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2007, 05:29 PM
  3. Hyperlink Parsing Starting at "wrong" row
    By Peaceful4getFul in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-10-2007, 03:44 PM
  4. Extract url from hyperlink
    By ssim in forum Excel General
    Replies: 1
    Last Post: 04-03-2007, 11:02 AM
  5. Paste hyperlink to a hyperlink in another sheet
    By skiman123321 in forum Excel General
    Replies: 1
    Last Post: 12-14-2006, 07:25 PM

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