+ Reply to Thread
Results 1 to 3 of 3

VBA Hyperlink to sheet based on cell value

  1. #1
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    MS office 2016
    Posts
    2

    Question VBA Hyperlink to sheet based on cell value

    Hello all.

    I'm fairly new to VBA and completely new to this forum

    Hoping to get some help to finalize a hyperlink code;
    The aim is to hyperlink each cell in a specific range on in my worksheet, to the sheet with the cell value name.

    I read quite some threads already on the topic and it got me as far as successfully linking the first cell within the range to the correct sheet!!

    Now I'm stuck at repeating the hyperlink code to remaining cells.

    ---
    My code:
    Sub Hyperlink()

    Dim Cell As Range

    Sheets("Bank Coverage").Range("C38:C120").Select

    For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)

    If Cell <> "" Then
    ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, Address:="", SubAddress:="'" & ActiveCell.Value & "'!A1"

    End If

    Next
    End Sub
    ---

    Could one of you kind folks help me understand what I need to do to apply the hyperlink for remaining cells in range C38:C120, please?
    Suspecting it's something with the range selection in my ActiveSheet.UsedRange part of the code?

    Unfortunately, I cannot share the Excel file with the code at the moment.

    Thank you!
    Charlotte

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

    Re: VBA Hyperlink to sheet based on cell value

    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
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    MS office 2016
    Posts
    2

    Re: VBA Hyperlink to sheet based on cell value

    Worked like a charm! Thank you so 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. [SOLVED] Hyperlink to another sheet in workbook based on value in cell
    By Lmao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2019, 07:14 AM
  2. [SOLVED] VBA to create Hyperlink to sheet based on Cell value
    By G.Bregvadze in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2018, 03:51 AM
  3. [SOLVED] Create Hyperlink to Sheet based on Cell Value
    By PJenkins in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2017, 11:14 AM
  4. [SOLVED] Move a hyperlink to a new sheet based on a cell value
    By rosshkerr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2015, 04:21 PM
  5. 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
  6. Hyperlink cell in another sheet based on value.
    By Hakey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-16-2014, 03:06 AM
  7. Replies: 1
    Last Post: 08-06-2013, 02:47 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