Toggle Check Marks on Double-Click in Two Excel Columns
Question details
Extend an existing Excel double-click macro so it toggles check marks in two separate column ranges.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses a Worksheet_BeforeDoubleClick event to insert or remove check marks in B3:B50, and the same behavior is needed in G3:G50.
- Observed behavior
- The existing macro handles B3:B50 but does not handle G3:G50.
Open the workbook in a desktop version of Excel that supports VBA, and locate the existing Worksheet_BeforeDoubleClick procedure in the relevant worksheet's code module. Save the workbook as an Excel Macro-Enabled Workbook (.xlsm) and enable macros if prompted.
Expand the double-click event range to include both columns
Use this change to keep the existing check-mark toggle logic while applying it to B3:B50 and G3:G50.
Right-click the relevant worksheet tab in Excel and select View Code. Find its existing Worksheet_BeforeDoubleClick procedure.
Replace the existing Intersect condition with: If Not Intersect(Target, Me.Range("B3:B50,G3:G50")) Is Nothing Then
Inside that If block, retain the existing code that inserts or removes the check mark, and make sure it includes Cancel = True. Leave the closing End If and End Sub in place.
Save the .xlsm workbook, return to the worksheet, and double-click a cell in each range twice. The check mark should appear and then disappear without entering normal cell-editing mode.

Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing spreadsheets. Its Excel format compatibility can make moving everyday spreadsheet work easier, although it does not fix Excel's VBA event code and macro support may differ.

Frequently Asked Questions
Where should I put the Worksheet_BeforeDoubleClick code?
Right-click the relevant worksheet tab and select View Code. The event procedure belongs in that worksheet's code module, not in a standard module.
Why does the cell enter edit mode when I double-click it?
Make sure Cancel = True is inside the If block for the target ranges. This prevents Excel's normal double-click editing behavior for those cells.
Will the macro run outside B3:B50 and G3:G50?
The toggle code inside the Intersect condition runs only when the double-clicked cell is in B3:B50 or G3:G50. Other code in the event procedure may still run.
Why did my VBA code disappear after saving?
An .xlsx file cannot retain VBA macros. Use File > Save As and select Excel Macro-Enabled Workbook (.xlsm) to preserve the code.




