Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to replace filtered data without disabling filter in Excel?

Author Kelly Last modified

When working with large datasets in Excel, it is common to filter data to focus only on specific records or categories. However, a frequent challenge arises when you need to replace or update information within these filtered rows, while keeping the filter in place. For instance, imagine spotting several spelling mistakes, outdated entries, or needing to update a portion of your filtered data. Normally, you might think to disable the filter, perform replacements, and then reapply the filter—but this can disrupt your workflow and even risk data being overlooked or inadvertently changed in hidden rows. Instead, there are several more efficient methods that allow you to replace filtered data without disabling the filter, ensuring that only the visible, filtered subset is affected while the hidden rows remain untouched.

Below, we’ll explore practical techniques including built-in Excel shortcuts, advanced utilities from Kutools for Excel, as well as powerful ways to achieve dynamic replacements using VBA and formulas—each with their value, best practice scenarios, and essential tips:


Replace filtered data to same value without disabling filter in Excel

For example, if you find some spelling errors or need to standardize entries in a filtered list, you may want to correct these all at once for the visible rows only, without modifying the hidden (filtered-out) data. Excel provides a useful shortcut that enables you to select only the visible cells in your filtered range. This operation is efficient for making uniform replacements or quick batch updates.

Note: Replacing with this method will overwrite all selected visible cells with the same value; if each cell requires a unique entry, consider other solutions below.

1. Select the cells in the filtered range that you need to replace. Then, press Alt + ; simultaneously. This action will highlight only the visible (filtered) cells while ignoring any hidden rows.

a screenshot of selecting only visible cells

Troubleshooting tip: If Alt + ; does not work, make sure your selection covers the cells you actually want to change and that the filter is properly applied.

2. Type the value you want to enter, then press Ctrl + Enter together. This command inputs your new value into all the selected (visible) cells at once.

Upon pressing these keys, all visible, filtered cells within your selected range will be updated to the new value instantly, with hidden rows remaining unchanged.

a screenshot showing the original data and replacement results

Benefits: Simple and quick for unified replacements; no add-ins required. Limitation: All selected cells will be replaced by the exact same value.

Tip: To undo changes, simply press Ctrl + Z after the operation.


Replace filtered data with exchanging filtered data with other ranges

Sometimes, updating filtered data requires more than a single value replacement—you may want to swap your filtered range with another range of equal size, without disturbing the filter. This is particularly useful for data comparison, dataset versioning, or restoring previous values. With Kutools for Excel’s Swap Ranges utility, you can achieve this interchange smoothly.

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy permanently free AI features! Download now!

1. Go to the Excel ribbon and choose Kutools > Range > Swap Ranges, which activates the Swap Ranges dialog.

a screenshot of enbaling the Swap Range feature of Kutools

2. In the dialog box, set the first box (Swap Range1) to your range of filtered, visible data, and set the second box (Swap Range2) to the data range you want to exchange with. Make sure both ranges have the same number of rows and columns for a successful swap.

a screenshot showing how to configure the Swap Ranges dialog box

3. Click OK. Kutools will instantly exchange the values between the two ranges, while keeping your filter intact. The filter setting remains unchanged; only the specified cell contents are swapped.

After performing this action, verify the swapped content for accuracy. The operation does not affect other filtered-out data.

a screenshot of the swapped results without affecting filtering

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now

Benefits: Handles entire ranges for swap operations in filtered data; useful for comparative analysis. Note: The swapped ranges should match in size; otherwise, an error will occur.


Replace filtered data with pasting ignoring filtered rows

Beyond swapping, sometimes you have new data ready to paste into your filtered area, but only want to update the visible (shown) rows and skip over the hidden ones. Kutools for Excel’s Paste to Visible Range utility provides a convenient way to paste copied data directly into only visible cells within a filtered list. This is helpful for quick batch updates, data imports, or copying results from another part of your workbook.

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy permanently free AI features! Download now!

1. Select the range containing the data you wish to use for replacement. Then go to Kutools > Range > Paste to Visible Range to activate the tool.

a screenshot showing how to enable the Paste to Visible Range feature

2. In the popup dialog, select the destination range in your filtered data where the new values will be pasted. Click OK to apply.

a screenshot of selecting the filtered data range

Kutools will automatically match your pasted values only to the visible (filtered) rows, leaving hidden rows unchanged—the ideal solution for accurate, targeted replacements in filtered listings.

a screenshot of the final results

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now

Benefits: Great for updating filtered records with multiple new values at once; no need for manual copy/paste row by row. Tips: Ensure the source and visible target ranges contain the same number of cells to prevent data misalignment.


VBA: Replace data only in visible (filtered) cells

For more complex or dynamic replacement operations—such as replacing specific words, updating values based on criteria, or applying pattern-based changes—you can use a VBA macro to selectively replace data in only the visible cells of a filtered range. This approach is particularly powerful for large datasets, custom logic, or automating updates across multiple sheets.

Applicable scenarios: Ideal for complex replacements, batch updates, or task automation.

Advantages: Flexible, programmable, supports multiple replacement rules.

Drawbacks: Requires VBA knowledge; changes apply immediately—back up your file first.

1. Click Developer > Visual Basic. In the Microsoft Visual Basic for Applications window, click Insert > Module, and paste the following code into the module:

Sub ReplaceVisibleCellsOnly_Advanced()
    ' Updated by ExtendOffice
    Dim rng As Range
    Dim cell As Range
    Dim searchText As String
    Dim replaceText As String
    Dim xTitleId As String

    On Error GoTo ExitSub
    xTitleId = "KutoolsforExcel"

   
    Set rng = Application.InputBox("Select the filtered range:", xTitleId, Selection.Address, Type:=8)
    If rng Is Nothing Then Exit Sub

 
    searchText = Application.InputBox("Enter the text/value to be replaced:", xTitleId, "", Type:=2)
    If searchText = "" Then Exit Sub
    replaceText = Application.InputBox("Enter the new text/value:", xTitleId, "", Type:=2)

    On Error Resume Next
    For Each cell In rng.SpecialCells(xlCellTypeVisible)
        If Not IsError(cell.Value) Then
            If InStr(1, cell.Value, searchText, vbTextCompare) > 0 Then
                cell.Value = Replace(cell.Value, searchText, replaceText, , , vbTextCompare)
            End If
        End If
    Next cell
    On Error GoTo 0

    MsgBox "Replacements completed in visible cells.", vbInformation, xTitleId
ExitSub:
End Sub

2. Click the Run button Run button to execute the macro. First, select the filtered range. Then, enter the value you want to replace and the new value. The macro will apply replacements only to visible cells, leaving hidden rows unchanged.

Notes and Tips:

  • If your filtered range includes formulas, this macro will overwrite them with new values. Consider backing up your data first.
  • If you encounter an error regarding visible cells, verify that the selected range is filtered and includes visible rows.
  • This method works for both text and numeric values. For more advanced scenarios, extend the code using string functions like Replace or InStr.

Excel formula: Dynamically process or replace filtered data

For situations where you want a formula-driven method to “replace” or alter displayed values based on whether a row is visible (i.e., not filtered out), you can use a combination of SUBTOTAL and conditional logic like IF or IFERROR. This approach is ideal for dynamic reporting or visual substitutions without modifying the original data.

Applicable scenarios: Dynamic summaries, conditional exports, side-by-side replacements

Advantages: Code-free, filter-responsive, non-destructive

Drawbacks: Doesn't modify original data; results appear in helper columns

1. Suppose your data is in range A2:A100. In the adjacent cell (e.g., B2), enter this formula:

=IF(SUBTOTAL(103, OFFSET(A2, 0, 0)), IF(A2 = "oldvalue", "newvalue", A2), "")

Explanation:

  • SUBTOTAL(103, OFFSET(A2, 0, 0)) returns 1 if the row is visible, 0 if hidden.
  • If visible and A2 equals "oldvalue", it shows "newvalue"; otherwise, it shows A2's value.
  • If the row is filtered out, the formula returns a blank.

2. Press Enter and drag the formula down. The logic dynamically applies to visible rows. To finalize the results, copy the helper column and use Paste Special → Values to overwrite the original data.

Advanced tips:

  • You can use functions like SEARCH, SUBSTITUTE, or REPLACE to perform partial or conditional replacements based on text patterns.
  • Always confirm the results before using Paste Special → Values to overwrite original data, especially in production workbooks.

Demo: replace filtered data without disabling filter in Excel

 
Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Related articles:


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in