VBA & Macro Problems

Fill Multiple Excel Cells with TRUE Using a Button or Macro

Ayan MasoodAyan Masood Nov 13, 2026 869 views

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.

Fill Multiple Excel Cells with TRUE Using a Button or Macro
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".
Before you start

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).

Solution 1Recommended

Fill all selected Excel cells with TRUE at once

Use this method for a one-time update without creating a macro.

1
Select the target cells

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.

2
Enter the Boolean formula

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.

3
Apply the entry to every selected cell

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.

Fill all selected Excel cells with TRUE at once
Boolean TRUE is not quoted text: Use =TRUE or =TRUE(). Do not use ="TRUE" or an apostrophe before TRUE if you need a logical value rather than text.
Fill Boolean values in WPS Spreadsheets

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. 1. Open the spreadsheet: Launch WPS Spreadsheets and choose Open to load your workbook.
  2. 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. 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. 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.
Fill a selected range with Boolean TRUE in one action.Open and save Microsoft Excel .xlsx and .xls files.Use a familiar spreadsheet interface for selecting ranges and entering formulas.Complete the manual fill task without enabling VBA macros.
microsoft office alternative - wps office

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.