Fill Multiple Excel Cells with TRUE Using a Button or Macro
Question details
The user needs to populate multiple Excel cells with the Boolean value TRUE, either in one manual action or through a reusable macro or button.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Apply the same Boolean value to a selected range of cells and optionally repeat the action using a button.
- Observed behavior
- The desired result is for every target cell to contain Boolean TRUE rather than the text string "TRUE".
Identify the exact cells to update, since this action replaces their existing contents. For the button method, use desktop Excel with macro recording available and plan to save the workbook as an Excel Macro-Enabled Workbook (.xlsm).
Fill all selected Excel cells with TRUE at once
Use this method for a one-time update without creating a macro.
In the worksheet, select the range you want to populate, such as B2:B100. In Excel for Windows, hold Ctrl while selecting additional cells or ranges if they are not adjacent.
With the cells still selected, type =TRUE in the active cell without pressing Enter yet. You can also use =TRUE(), which explicitly calls the TRUE function.
In Excel for Windows, press Ctrl+Enter instead of Enter. Excel places the entry in every selected cell, and each cell evaluates to Boolean TRUE.

Record an Excel macro and assign it to a worksheet button
Use this method when the same fixed cells need to be set to TRUE repeatedly.
Set Multiple Cells to TRUE in WPS Spreadsheets
For the cell-filling task, WPS Spreadsheets lets you enter the TRUE function across a selected range without creating a VBA macro. This is a straightforward option when you need the Boolean values but not an Excel macro button.
- 1. Open the spreadsheet: Launch WPS Spreadsheets and choose Open to load your workbook.
- 2. Select the cells to update: Drag across the target range, or type a range such as B2:B100 in the Name Box and press Enter.
- 3. Fill the selected range: Type =TRUE() without pressing Enter, then press Ctrl+Enter in the Windows desktop version to apply the formula to all selected cells.
- 4. Check and save the results: Click a few cells in the range to confirm that they display TRUE, then choose Menu > Save or press Ctrl+S.

Frequently Asked Questions
Do I need a macro just to put TRUE in several cells?
No. Select the cells, type =TRUE or =TRUE(), and press Ctrl+Enter in Excel for Windows. A macro is useful when you want to repeat the same update with a button.
What is the difference between =TRUE() and ="TRUE"?
=TRUE() returns the logical value TRUE. ="TRUE" returns a text string. Use the logical value when the cells feed formulas or other features that expect Boolean data.
Can I fill cells that are not next to each other?
Yes. In Excel for Windows, hold Ctrl while selecting each cell or range. Type =TRUE() and press Ctrl+Enter to fill all selected areas.
Will the recorded macro include new rows automatically?
Not if it records a fixed range such as B2:B100. To change the targets, record the macro again with the new selection or edit its range reference through Developer > Macros > select the macro > Edit. Automatically finding the last row requires additional VBA logic.
Why does my macro button stop working after saving the workbook?
Check that you saved through File > Save As using Excel Macro-Enabled Workbook (*.xlsm), since .xlsx files cannot retain VBA code. Also check whether macros are blocked by Excel security settings or your organization's policy; only enable code from a trusted source.




