+ Reply to Thread
Results 1 to 5 of 5

Create a hyperlink to a place in the document using cell contents

  1. #1
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Create a hyperlink to a place in the document using cell contents

    Hi there
    if I am in a workbook in a cell with the contents:
    'worksheet1'!A1

    What would I have to put in a macro so that a hyperlink is created, in that cell, to the location 'worksheet1'!A1 (which is in the same workbook)? The macro would be executed while I am in the cell.

    So I am after a macro that converts a worksheet/cell reference that is not a hyperlink, into a hyperlink.

    Thanks for any help.
    Stu

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create a hyperlink to a place in the document using cell contents

    Make sure all the sheet names are surrounded by single quotes as in your example 'worksheet1'!A1

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Create a hyperlink to a place in the document using cell contents

    Hi alphafrog
    I removed the apostrophe from the first line.
    The macro creates a hyperlink but it doesn't actually put the reference in the hyperlink (see screenshot pasted in worksheet). You can see this is the case because the hyperlink dialog box screenshot which I put in the worksheet shows that the reference isn't in the field "Type the cell reference:". Do you know why it isn't working?
    Thanks! Stu

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Stuartzz; 07-07-2018 at 02:13 AM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create a hyperlink to a place in the document using cell contents

    Try this. Also, you have to have the sheet name already exist. Your example file doesn't have a sheet named 2plan.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Create a hyperlink to a place in the document using cell contents

    That's awesome thanks alphafrog!

+ 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. [SOLVED] Macro to create a document AND hyperlink it to a cell
    By mparker123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-01-2014, 08:53 AM
  2. Create hyperlink paths based on cell contents
    By fundam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 04:19 PM
  3. Get hyperlink with place in document from cell
    By danped1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 12:17 PM
  4. macro to create a hyperlink from excel to word document.
    By pinguino in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-25-2013, 08:28 AM
  5. Hyperlink problem:'Place in this document'
    By twobits in forum Excel General
    Replies: 1
    Last Post: 05-10-2010, 09:37 PM
  6. How to create a Web Hyperlink based on Cell Contents?
    By chatguy in forum Excel General
    Replies: 2
    Last Post: 10-15-2007, 04:24 PM
  7. Replies: 1
    Last Post: 05-29-2006, 09:53 PM
  8. Replies: 0
    Last Post: 10-21-2005, 05:05 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