VBA & Macro Problems

How to Use Excel VBA to Select Matching Names Instead of Hyperlinks

Amos GikundaAmos Gikunda Oct 28, 2026 869 views

Question details

The user needs to use a VBA script to automatically jump to a matching account name in column B when a name is clicked in another area, replacing the need for static hyperlinks.

How to Use Excel VBA to Select Matching Names Instead of Hyperlinks
Product
Excel
Device & OS
not provided
Scenario
Navigating a worksheet with repeating groups of names where standard hyperlinks become too difficult to maintain after additions or changes.
Observed behavior
The user requires a dynamic method to locate and select the corresponding entry in column B whenever a cell in columns I through L is clicked.
Before you start

Ensure your workbook is saved in a macro-enabled format (.xlsm) and that you have enabled macros in your spreadsheet security settings before adding VBA code.

Solution 1Recommended

Implement a Worksheet Selection Change VBA Event

Use a VBA macro within the specific worksheet module to automatically jump to the corresponding cell in column B when a name is clicked in columns I through L.

Using a Worksheet_SelectionChange event is highly effective for dynamic navigation. When you select a cell in the defined range, the macro searches for the identical value in column B and selects it automatically, completely bypassing the need for static hyperlinks.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications editor.

2
Access the Worksheet Module

In the Project Explorer panel on the left, double-click the specific sheet name (e.g., Sheet1) where you want the macro to function.

3
Define the Target Range

Paste your SelectionChange code into the module window. Ensure you define the target range properly by using `Set Target = Intersect(Target, Range("I:L"))` if your names span columns I, J, K, and L.

4
Add the Lookup Logic

Include the `Range.Find` method within your script to search column B for the value of the clicked cell and then select that matched cell.

5
Test the Macro

Close the VBA editor. Click on any name in columns I through L to verify that Excel automatically selects the matching name in column B.

Implement a Worksheet Selection Change VBA Event
Adjusting the Search Columns: If you decide to add or remove columns later, simply update the `Range("I:L")` portion of the code to reflect your new data layout.
WPS Spreadsheet VBA alternative

Manage Your Macros Easily with WPS Office

WPS Spreadsheet provides a robust, built-in environment for running Excel VBA macros. You can seamlessly write, edit, and execute your navigation scripts to manage complex data lists without paying for expensive software.

  1. 1. Download and Install WPS Office: Get the free WPS Office suite from the official website and install it on your computer.
  2. 2. Open Your Workbook: Launch WPS Spreadsheet and open your Macro-enabled Excel file (.xlsm).
  3. 3. Access the Developer Tools: Go to the 'Developer' tab on the top ribbon and click on 'Visual Basic' to access the VBA editor.
  4. 4. Edit Your Macro: Modify your `Worksheet_SelectionChange` code exactly as you would in Microsoft Excel, then save your progress.
Fully compatible with Microsoft Excel VBA syntax and macro-enabled files (.xlsm).Lightweight application that loads large datasets and macros quickly.Intuitive developer tools for editing, running, and debugging VBA code.Free to download and use for your daily spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my VBA SelectionChange event triggering when I click a cell?

Macros might be disabled in your security settings, or the code may have been mistakenly placed in a standard module (like Module1) instead of the specific Worksheet module where the action is taking place.

How do I modify the VBA code to look for matches in a different column instead of B?

You need to change the search range in your `Range.Find` logic from `Range("B:B")` to the new target column letter, for example, `Range("C:C")`.

Is using VBA better than using Excel hyperlinks for navigation?

Yes, especially if your data changes frequently. Hyperlinks require manual updates when cells move, whereas VBA dynamically searches for the matching value regardless of its new position within the designated column.