+ Reply to Thread
Results 1 to 8 of 8

VBA to create hyperlink on each cell which display detail of other sheet

  1. #1
    Registered User
    Join Date
    10-20-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    13

    VBA to create hyperlink on each cell which display detail of other sheet

    Hi All,

    I need to check all the details in master sheet when clicking on any ID from child sheet through hyperlinking (or any alternative). I am able to do manually for only one row but can not proceed when 1000 of row are there in the child sheet. Doing manually will take lots of time. Is there any alternative approach or developing a macro can automate this process.

    e.g. from the attached sheet, when I click on value '92315' from child sheet, it should select the entire row from master sheet when matching ID. If not match, it should say 'not matched'
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    You don't need to hyperlink all the cells - you can use VBA code to find and select the row of interest.

    1) Copy this code.
    2) Right-Click the sheet tab of "Child".
    3) Select "View Code"
    4) Paste the code into the window that appears.
    5) Save the file as a macro-enabled .xlsm file.
    6) Make changes as needed


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    10-20-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    13

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    Thank you Bernie for the solution. Its working fine except blank cell.
    When I am clicking on the blank cell, it is selecting the empty cell in next sheet. Is it possible to restrict it.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    Why would you click on a blank cell?

    Change

    Please Login or Register  to view this content.
    to include

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-20-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    13

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    The macro is working for partial match only.
    e.g. if ID '5121' present in child sheet, then it highlights the ID '512101' available in master sheet but not the exact '5121' ID.
    Could you please help me how to find for exact match.
    Uploaded the sheet for your reference.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,223

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    The problem with using the SelectionChange event is that you cannot select the selected cell without moving to another sheet. Admittedly, you can select multiple cells starting with the cell you are interested in (e.g. for editing).
    I went in the direction of creating hyperlinks. For this solution I say they are fake hyperlinks because they pointed to themselves. But for this you can use the FollowHyperlink event. The whole thing in the attachment.

    Artik
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    Replace

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    But, ultimately, you should use an ID system that follows specific rules that don't allow that sort of error: e.g., all telephone numbers are 10 digits - not 9, not 11 - exactly 10. So you should not have 5121 as an ID if 512101 is also an ID.

    If selecting the cells is an issue, you can either change from the selection event to the BeforeDoubleClick event, or you can turn events on and off as needed, using simple macros:

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 06-29-2022 at 10:09 AM.

  8. #8
    Registered User
    Join Date
    10-20-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    13

    Re: VBA to create hyperlink on each cell which display detail of other sheet

    Thank you Bernie and Artik for the solution.

+ 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] Need macro to Search EID or TID and display detail in other sheet
    By abraham30 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2021, 05:20 AM
  2. [SOLVED] Create hyperlink from cell contents and specified “text to display”
    By Stuartzz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2019, 04:22 AM
  3. [SOLVED] Display pivot table detail in pre-named sheet
    By spyac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2018, 01:53 PM
  4. [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
  5. [SOLVED] Macro to Create Hyperlink with Sheet Name/Cell Reference Message Box
    By yohanmcdonald in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-28-2017, 03:08 PM
  6. [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
  7. Replies: 0
    Last Post: 03-26-2013, 01:31 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