Fix Excel PivotSelect Error 1004: Formula Is Incomplete
Question details
The user needs to resolve runtime error 1004 when a VBA macro uses PivotSelect on a PivotTable.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A VBA macro selects a PivotTable field or item whose name may contain spaces or special characters.
- Observed behavior
- PivotSelect reports that the formula is incomplete when the selection string or referenced name does not match the PivotTable structure.
Open the workbook and identify the PivotTable and field or item the macro should select. Make sure the Developer tab is available so you can inspect the VBA code and record a test selection.
Correct the PivotSelect field, item, and selection string
Use this method when PivotSelect references a field such as OFF FORM or an item whose spelling or syntax may be incorrect.
Open Developer > Visual Basic, find the macro, and identify the PivotSelect statement that raises error 1004. Check which worksheet and PivotTable the statement references.
Click the target PivotTable and open PivotTable Analyze > Field List. Compare the field name and relevant item labels with the names in the VBA selection string, including spaces and punctuation.
Use Developer > Record Macro, select the desired field or item in the PivotTable, and then stop recording. Inspect the recorded code in Developer > Visual Basic for a PivotSelect statement and use its selection syntax as a guide. Recording may not produce a PivotSelect statement for every selection.
In the original PivotSelect statement, correct the field or item names and any required brackets or quoting. Run the macro again from Developer > Macros and confirm that it selects the intended part of the PivotTable.

Work with PivotTables in WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar interface and support for Excel files, making it easy to move everyday spreadsheet work across. It does not directly fix an Excel-specific PivotSelect VBA error.

Frequently Asked Questions
Why does PivotSelect report that the formula is incomplete?
The selection string may contain an incorrect field or item name, or it may use invalid brackets or quoting. Compare the VBA statement with the target PivotTable's Field List and item labels.
How can I check whether OFF FORM is in the correct PivotTable?
Click the PivotTable referenced by the macro and open PivotTable Analyze > Field List. Look for OFF FORM and compare its spelling and spaces with the name used in the code.
Can the macro recorder show the correct PivotSelect syntax?
It can help in some cases. Choose Developer > Record Macro, select the target field or item, stop recording, and inspect the code in Developer > Visual Basic. Not every recorded selection produces a PivotSelect statement.
What should I do if the field no longer appears?
Confirm that the macro targets the intended PivotTable, then choose PivotTable Analyze > Refresh. If the field is still missing, check the PivotTable's source data and field names.




