How to Center a Linked Cell in Excel When Navigating Worksheets
Question details
The user wants to navigate to another worksheet via a link and have the destination cell automatically centered on the screen.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Clicking a hyperlink to jump to a specific cell on a different worksheet, aiming for an optimal centered view of the target data.
- Observed behavior
- Standard Excel hyperlinks successfully navigate to the target cell, but they leave the cell at the edge of the screen rather than adjusting the scroll position to center it.
Ensure that the Developer tab is enabled in your ribbon and that your workbook is saved as a Macro-Enabled Workbook (.xlsm), as standard hyperlinks cannot control scroll positions.
Use a VBA Macro to Center the Destination Cell
Since built-in Excel hyperlinks do not adjust the window's scroll view, you must use a VBA macro to navigate to the target cell and manually offset the scroll row and column.
The standard =HYPERLINK() function or Insert Link feature only selects the target cell. To manipulate the view, VBA's ActiveWindow scroll properties are required.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
In the left-hand Project Explorer pane, right-click your workbook name, choose Insert, and then select Module.
Paste the following script into the module window: Sub GoToCellInCenter() Application.Goto Reference:="Sheet2!B15", Sheets("Sheet2").Select, ActiveWindow.ScrollRow = ActiveCell.Row - (ActiveWindow.Height / 2), ActiveWindow.ScrollColumn = ActiveCell.Column - (ActiveWindow.Width / 2) End Sub. (Note: You may need to adjust the division math depending on your specific row heights and column widths).
Return to your worksheet, go to Insert > Shapes, draw a shape to act as your link, right-click it, and choose Assign Macro. Select GoToCellInCenter and click OK.

Easily Manage VBA Macros with WPS Spreadsheet
WPS Office provides robust, built-in support for VBA macros. You can run scripts to center linked cells exactly as you would in Microsoft Excel, enjoying a smooth, lightweight, and completely compatible spreadsheet experience.
- 1. Open Your Macro Workbook in WPS: Launch WPS Spreadsheet and open your existing macro-enabled workbook. Go to the Developer tab to ensure macros are activated.
- 2. Access the VBA Editor: Click the 'Visual Basic' icon in the Developer tab or press Alt + F11 to view and modify your centering scripts.
- 3. Run the Navigation Script: Use your customized buttons or shapes in the worksheet to trigger the macro, effortlessly jumping to and centering your target linked cells.

Frequently Asked Questions
Why doesn't the standard HYPERLINK function center the cell?
The HYPERLINK function is strictly designed to select the destination cell or open a file. It does not have access to the application window's scrolling parameters required to physically reposition the screen view.
Do I need to write a separate macro for every single hyperlink?
If you hardcode the destination (like Sheet2!B15), yes. However, you can write a more advanced, dynamic VBA script that reads the target destination from the cell you clicked on, allowing a single macro to handle multiple links.
Can I use the Application.Goto Scroll argument instead?
Yes, you can use Application.Goto Reference:="Sheet2!B15", Scroll:=True. However, this places the destination cell in the top-left corner of the window rather than the center. The ActiveWindow.ScrollRow and ScrollColumn method is required for true centering.




