VBA & Macro Problems

Delete Excel Rows with Blank Values or Duplicate IDs

Phi Hung VoPhi Hung Vo Nov 14, 2026 869 views

Question details

Delete Excel rows when the EXP cell is blank or a company identifier is duplicated.

Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains records that need to be removed based on an EXP value or repeated company ID.
Observed behavior
Formulas can identify matching records but cannot delete worksheet rows directly.
Before you start

Identify the EXP column, the company ID column, and the first and last data rows. Check whether blank-looking EXP cells are genuinely empty or contain formulas that return an empty string.

Solution 1Recommended

Delete rows with empty EXP cells using Go To Special

Use this method for a one-time cleanup of genuinely empty cells in the EXP column.

1
Select the EXP data cells

Select only the EXP cells within your data range, such as C2:C100. Exclude the header and unused rows below the data.

2
Find empty cells

Choose Home > Find & Select > Go To Special, select Blanks, and click OK.

3
Delete entire rows

Right-click one of the selected blank cells, choose Delete, select Entire Row, and click OK.

Delete rows with empty EXP cells using Go To Special
Formula results are different: Go To Special > Blanks selects genuinely empty cells, not cells containing formulas that return an empty string. Use the column filter to review blank-looking values if formulas are involved.
Work with spreadsheets in WPS Office

Delete blank EXP rows in WPS Spreadsheets

Use a filter in WPS Spreadsheets to find blank EXP values, inspect the matching records, and delete their rows.

  1. 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 2. Filter the EXP column: Select the dataset, choose Data > Filter, and open the filter arrow in the EXP header. Select the blank-value option and apply the filter.
  3. 3. Delete matching rows: Review the visible records, select their row headers, then right-click and choose Delete Row.
  4. 4. Clear the filter: Open the EXP filter menu and clear the filter to review the remaining records.
Review blank EXP records before deleting rowsOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interfaceWork with a free office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can an Excel formula delete a row automatically?

No. A formula can flag a row for deletion, but you must use a feature such as a filter or a VBA macro to remove the row.

Why did Go To Special miss a blank-looking EXP cell?

The cell may contain a formula that returns an empty string. Go To Special > Blanks selects genuinely empty cells; use the EXP column filter to review blank-looking results.

How does Excel decide which duplicate company record to keep?

Data > Remove Duplicates keeps the first occurrence in the current row order. Sort the full dataset first if you need a particular record to remain.

How do I change the EXP column used by the macro?

In the VBA editor, replace C2:C100 in the Range reference with the actual EXP data range, excluding the header and unused rows.