+ Reply to Thread
Results 1 to 10 of 10

Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

  1. #1
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Question Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    I am wondering if anyone can help with writing a macro to execute on a ctrl+w and does the following:
    Pop up a Userform with a TextBox
    (I type a specific sheet name within the same Workbook and hit enter to exit the Userform)
    The active cell I am in creates a hyperlink to the typed in sheet name reference in cell B11
    Error message for improper sheet name

    Can anyone help me out??
    Last edited by yohanmcdonald; 09-28-2017 at 03:09 PM.

  2. #2
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    Hello yohanmcdonald,

    I'm close to working something out for you but am wondering if the hyperlink is supposed to always reference B11 of whatever sheet name is entered in the userform?

    That's what it seemed like in your original post but i'm wanting clarification.

    Thanks,

    DarkF1ame
    Mark as "Solved" and add Reputation if applicable.

  3. #3
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    Yes, the sheets are all the same layout and the link needs to link to the same spot on each sheet.

  4. #4
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    yohanmcdonald,

    I have come up with something that I feel meets your needs. Upon pressing Ctrl+w the currently selected cell's formula becomes a hyperlink to SheetName (specified by the User Form) Range B11. If the sheet name is blank or doesn't exist it will throw a message box and then do nothing.

    Hope you are able to pull the userform and macros into your own sheet.

    Let me know if I can help further.

    Thanks,

    DarkF1ame
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    I got everything to work exactly how I needed it except I forgot to mention that the cell that is becoming a hyperlink is a formula and needs to remain that way. How do I change the code to allow the cell to stay as the formula instead of changing to Link??

  6. #6
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    Is the cell currently just displaying a formula and not actively making calculations? I don't know of a way to have a cell be both a formula and a hyperlink. If you want a formula displayed instead of the word link that can be done.

    Let me know,

    DF

  7. #7
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    This is what it is displayed as (with hyperlink)
    ExcelQuestion.JPG

  8. #8
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    yohanmcdonald,

    I think I got it. In the OKButton_Click() macro make the following changes in the lines before defining "link":

    Please Login or Register  to view this content.
    Let me know if that works, it looks like its working on my end.

    DarkF1ame

  9. #9
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    PERFECT!! Thank you for the help! That worked out exactly how I needed it.

  10. #10
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box

    Glad it worked out. Have a nice day!

+ 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. Macro to find a word in a cell, create a transparent text zone over it, create a hyperlink
    By martin brandl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2015, 03:24 PM
  2. macro to create a hyperlink to another sheet, does not work on spaces or symbols
    By Glitch_ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2015, 10:58 AM
  3. External cell reference based on hyperlink in a cell in the active sheet
    By Sydstar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-29-2014, 08:25 AM
  4. [SOLVED] Excel 2010 Create a macro to check if cell contains hyperlink then apply hyperlink style
    By chasidar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2013, 04:48 AM
  5. [SOLVED] Problem in Hyperlink - Reference to a cell of another sheet
    By abduljaleel.mca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 12:11 AM
  6. Macro to create sheet, rename sheet, and hyperlink to it
    By prescottfarm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2013, 04:46 PM
  7. Replies: 0
    Last Post: 11-15-2012, 09:51 AM

Tags for this Thread

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