VBA & Macro Problems

How to Search and Edit Filtered Excel Table Results Using VBA

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 868 views

Question details

The user needs to edit specific columns (J and K) of filtered search results within an Excel table, but the current filtered view prevents direct editing.

How to Search and Edit Filtered Excel Table Results Using VBA
Product
Excel
Device & OS
not provided
Scenario
Searching for a specific name in a large table to quickly update related information in columns J and K.
Observed behavior
The table displays matching names when filtered, but the resulting filtered cells in columns J and K cannot be edited as required.
Before you start

Always create a backup copy of your Excel workbook before implementing VBA macros, as macro actions typically cannot be undone using the standard Undo feature.

Solution 1Recommended

Use a VBA Macro to Filter and Edit In-Place

Applying a VBA macro allows you to filter the original table in place, enabling direct edits to the matching records.

When you extract data using advanced formulas or copy-paste methods, the resulting data is disconnected from the original dataset, preventing direct edits. By using a VBA macro to filter the original table in place, any changes you make to columns J and K are saved directly to the source data.

1
Open the VBA Editor

Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor.

2
Insert a New Module

In the top menu, click Insert and select Module to create a blank script window.

3
Add the Filter Code

Write or paste the VBA code designed to filter your specific table range based on your search criteria.

4
Save as Macro-Enabled

Close the VBA editor. Go to File > Save As, and choose Excel Macro-Enabled Workbook (*.xlsm) from the format dropdown.

5
Run and Edit

Run the macro to filter the names, then click directly into columns J and K to edit the information.

Use a VBA Macro to Filter and Edit In-Place
Enable Macros: You must click 'Enable Content' or adjust your Trust Center settings to allow macros to run when you reopen the workbook.

Easily Manage and Edit Filtered Tables in WPS Spreadsheet

WPS Spreadsheet provides powerful data management tools, including advanced filtering, custom views, and VBA support, enabling you to search and edit large datasets seamlessly.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your data file.
  2. 2. Apply AutoFilter: Select your table headers, navigate to the Data tab, and click the 'AutoFilter' button.
  3. 3. Search for records: Click the dropdown arrow on the name column header and type the name into the search box to filter the rows.
  4. 4. Edit directly: Click directly into the visible cells in columns J and K to update the information, which will save to the original dataset.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) formatsSupports advanced data filtering and sortingIncludes a built-in VBA editor for running custom macrosLightweight and fast even with large data tables
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I edit filtered results in a standard Excel formula extraction?

If your filtered results are generated by formulas like FILTER or VLOOKUP, they are dynamic arrays or lookup results, not the original cells. To edit the data, you must filter the source table in place or use VBA.

How do I save a workbook that contains VBA macros?

Go to File > Save As, and change the 'Save as type' to 'Excel Macro-Enabled Workbook (*.xlsm)'. If you save it as a standard .xlsx file, the VBA code will be permanently deleted.

Is there a way to edit filtered data without using VBA?

Yes. You can use the built-in AutoFilter feature on the Data tab. By applying a text filter directly to the name column of your source table, you can hide non-matching rows and safely edit the visible cells in columns J and K.