VBA & Macro Problems

Fix Excel Hidden Rows or Columns Becoming Visible Again

Huma Ashraf ChHuma Ashraf Ch Nov 11, 2026 869 views

Question details

The user needs to prevent hidden rows or columns in Excel from automatically unhiding when interacting with the worksheet.

How to Fix Excel Hidden Rows or Columns Becoming Visible Again
Product
Microsoft Excel
Device & OS
not provided
Scenario
Hiding rows or columns in a spreadsheet to conceal data, but they reappear unexpectedly upon interaction.
Observed behavior
Hidden rows or columns become visible again automatically, often triggered by clicking the sheet, running macros, or refreshing data.
Before you start

Before modifying settings or VBA code, ensure you save a backup copy of your Excel workbook to prevent accidental data or logic loss.

Solution 1Recommended

Disable or Modify VBA Event Macros

VBA event macros like Worksheet_SelectionChange are the most common cause for cells automatically unhiding.

If your workbook contains active macros, an event procedure might be programmed to change row or column visibility whenever you click a cell or switch sheets.

1
Open the VBA Editor

Press Alt + F11 to open the Microsoft Visual Basic for Applications window.

2
Locate the Event Procedure

In the Project Explorer pane, double-click 'ThisWorkbook' or the specific worksheet module where the issue occurs.

3
Find the Visibility Code

Look for code that modifies row or column visibility, such as 'Columns("A:B").Hidden = False'.

4
Comment Out the Code

Add an apostrophe (') at the beginning of the line to temporarily disable it (e.g., 'Columns("A:B").Hidden = False). Save the workbook and test if the issue is resolved.

Disable or Modify VBA Event Macros
Tip: You can use the Find feature (Ctrl + F) in the VBA Editor and search for 'Hidden = False' across the Entire Project to quickly locate the problematic macro.
Manage Spreadsheets Efficiently

Seamlessly Manage Data and Macros in WPS Spreadsheet

Use WPS Spreadsheet to securely hide sensitive rows and columns, easily manage VBA macros, and handle complex datasets without unexpected layout changes.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your existing spreadsheet.
  2. 2. Hide columns or rows: Select the rows or columns you wish to conceal, right-click the selection, and choose 'Hide'.
  3. 3. Manage Macros easily: Navigate to the 'Developer' tab and click 'Visual Basic' to easily inspect, edit, or disable any macros that might be altering your layout.
Fully compatible with Microsoft Excel (.xlsx, .xls, .xlsm) formats.Robust built-in VBA and macro support for advanced automation.Free, lightweight, and easy-to-use interface.Secure sheet protection to prevent unauthorized layout modifications.
microsoft office alternative - wps office

Frequently Asked Questions

Why do hidden columns reappear when I refresh my pivot table?

Pivot tables have a default setting that auto-fits column widths upon updating. To prevent this, right-click the pivot table, select 'PivotTable Options', and uncheck 'Autofit column widths on update'.

Can conditional formatting unhide rows automatically?

Conditional formatting rules alone do not unhide rows or columns. However, complex rules interacting with external data refreshes or corrupted workbooks can sometimes trigger unexpected layout resets.

How do I know exactly which macro is unhiding my cells?

Press Alt + F11 to open the VBA Editor, press Ctrl + F to bring up the search dialog, select 'Entire Project', and search for the exact phrase 'Hidden = False'. This will highlight the specific macro altering your layout.