+ Reply to Thread
Results 1 to 5 of 5

writing a hyperlink into a cell

  1. #1
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    writing a hyperlink into a cell

    I have a section of code which seperates document names into a variable called filenames and writes them to various cells, the line of code that currently writes the text is:
    Please Login or Register  to view this content.
    the value for "filename" is a document name. What I would like is to write a hyperlink to this filename in the cell rather than just the name
    I have tried recording a macro (say =hyperlink(A2) ) but the code generated doesn't seem to help me
    can anyone help with this?

    Thanks

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Hi,

    Try this:

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357
    Thanks Sweep, But I am getting an error message:
    Runtime error 5 - invalid procedure or call

    I guess this is to do with the address. I have tried replacing address=filename with address = thisworkbookpath but get the same error

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    It's working fine in the posted fomat for me with filename set as some excel file such as

    filename = "C:\test.xls"

  5. #5
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357
    Sweep,

    Sorry it was me being Dull

    It does work fine, thanks very much

+ 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. Add Hyperlink to cell via a userform
    By tapapad in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2010, 02:36 AM
  2. Hyperlink to cell in different worksheet,using variable integers to indicate the cell
    By emanuele.musa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2008, 01:32 PM
  3. Displaying [url] tags
    By Alderwood in forum Excel General
    Replies: 1
    Last Post: 10-01-2007, 02:22 PM
  4. Finding the the last cell address for writing macro
    By rms10 in forum Excel General
    Replies: 1
    Last Post: 08-15-2007, 05:07 AM
  5. Hyperlink to set cell value
    By ResulG in forum Excel General
    Replies: 10
    Last Post: 11-24-2006, 07:31 AM

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