logo
search
VBA & Macro Problems

How to Completely Hide Checkboxes in Hidden Excel Rows

Tauseeq MagsiTauseeq Magsi Sep 25, 2026 869 views

Question details

The user needs to make checkboxes completely invisible when the Excel rows containing them are hidden using VBA.

Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Hiding rows that contain form controls (checkboxes) via VBA macros or standard filtering.
Observed behavior
Even when checkboxes are set to 'move and size with cells', a small part of each checkbox remains visible when the row is hidden.
Before you start

Ensure your checkboxes are already configured to 'Move and size with cells' in their Format Control properties. If they are set to 'Don't move or size with cells', they will float over hidden rows regardless of their size.

Solution 1Recommended

Resize Checkboxes to be Smaller than the Cell

The most efficient method is to manually adjust the checkbox shape so its entire bounding box fits strictly inside the cell's borders.

When a checkbox overlaps the border of a cell even slightly, Excel fails to reduce its height to exactly zero when the row is hidden. Making the control's bounding box smaller than the cell eliminates the need for complex VBA workarounds.

1
Select the checkbox

Hold down the 'Ctrl' key and click on the checkbox to select it without triggering the checkmark.

2
Adjust the bounding box

Click and drag the sizing handles (the small circles around the checkbox) inward.

3
Fit within cell borders

Ensure that the entire outline of the checkbox is strictly inside the cell boundaries, not touching any gridlines.

4
Test row hiding

Run your VBA script or manually hide the row to confirm the checkbox is now completely hidden.

Resize Checkboxes to be Smaller than the Cell
Best Practice: This method avoids maintaining additional VBA code for every individual control, keeping your workbook lightweight.
WPS Spreadsheet Form Controls

Easily Manage Checkboxes and Macros with WPS Office

WPS Spreadsheet offers full compatibility with Excel files, including form controls like checkboxes and VBA macros. You can easily adjust control properties to ensure they hide perfectly with their underlying cells.

  1. 1. Insert a Checkbox: Open your file in WPS Spreadsheet. Go to the 'Insert' tab, select 'Forms', and click on the 'Checkbox' icon to draw it in a cell.
  2. 2. Modify Object Properties: Right-click the checkbox, select 'Format Object', and navigate to the 'Properties' tab.
  3. 3. Set Positioning: Choose 'Move and size with cells' to ensure the checkbox reacts correctly when rows are hidden or filtered.
  4. 4. Run your Macros: Use the built-in VBA environment in WPS Office to execute your row-hiding scripts flawlessly.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) formatsSeamless VBA macro execution and form control managementIntuitive drag-and-drop interface for precise object resizingLightweight, fast, and completely free to use
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel checkboxes bunch up when filtering or hiding rows?

This happens when the object positioning is set to 'Don't move or size with cells' or 'Move but don't size'. To fix this, right-click the checkbox, select Format Control > Properties, and choose 'Move and size with cells'.

How do I select multiple checkboxes to resize them at once?

You can select multiple checkboxes by holding the 'Ctrl' key while clicking each one. Alternatively, go to the Home tab, click Find & Select, choose 'Select Objects', and drag a selection box over all the checkboxes you want to adjust.

Can I link a checkbox to a specific cell value?

Yes. Right-click the checkbox, select 'Format Control', and navigate to the 'Control' tab. Click inside the 'Cell link' field and select the cell where you want the TRUE/FALSE value to appear.