Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to save / export only filtered data from Excel to csv file?

As we all known, it is easy for us to save a worksheet as csv file. But, have you ever tried to save only filtered data as csv file? Normally, the Save As feature In Excel will save the whole worksheet data as csv file, in this case, how could you save or export only filtered data from Excel to csv file?

Save / Export only filtered data from Excel to csv file with Copy Visible cells only

Save / Export only filtered data from Excel to csv file with VBA code

Save / Export only filtered data from Excel to csv file Kutools for Excel


Save or Export data or filtered data only from Excel to csv / pdf / txt  /html / xlsx file:

With Kutools for Excel's Export Range to File feature, you can quickly save or export the selected cells to csv, txt, pdf, xlsx, html files as you need.

doc save filtered data as csv 12

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!



In Excel, you may not save the filtered data to csv file directly, but, you can finish it with a workaround, please do as follows:

1. Select the filtered data that you want to save.

2. Then click Home > Find & Select > Go To Special, see screenshot:

doc save filtered data as csv 1

3. In the Go To Special dialog box, choose Visible cells only option, see screenshot:

doc save filtered data as csv 2

4. Then click OK button, and then copy and paste the filtered data to a new worksheet, and only the filtered data has been pasted into the new worksheet.

5. Now, you can save this new worksheet as csv file, please click File > Save As, in the Save As dialog box, specify a name and location for this file, and select CVS(Comma delimited) from the Save as type drop down list, see screenshot:

doc save filtered data as csv 3

6. Then click Save to save this filtered data, and some warning messages will pop out, please click OK and Yes to close the messages, and then only the filtered data is saved as csv file in your selected directory.

doc save filtered data as csv 4

 1

doc save filtered data as csv 5


It may be an inefficient way by using the above method, here, I can create a VBA code for helping you export the filtered data to csv file quickly and conveniently.

1. Hold down the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following macro in the Module Window.

VBA code: Save / Export only filtered data from Excel to csv file

Sub Macro1()
'updateby Extendoffice 20151109
    Dim xRg As Range
    Dim xCell As Range
    Dim xAddress As String
    Dim xUpdate As Boolean
    Dim xFileName As String
    Dim xWb As Workbook
    On Error Resume Next
    xAddress = Application.ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("please select the filtered range", "Kutools for Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xRg = xRg.SpecialCells(xlCellTypeVisible)
    If xRg Is Nothing Then Exit Sub
    xFileName = Application.GetSaveAsFilename(, "CSV Files (*.csv), *.csv", , "please specify the file name")
    If xFileName = "" Then Exit Sub
    xUpdate = Application.ScreenUpdating
    Application.ScreenUpdating = False
    xRg.Copy
    Set xWb = Application.Workbooks.Add
    xWb.ActiveSheet.Paste
    xWb.SaveAs Filename:=xFileName, FileFormat:=xlCSV, CreateBackup:=False
    xWb.Close False
    Application.ScreenUpdating = xUpdate
End Sub

3. Then press F5 key to run this code, and a prompt box is popped out to remind you select the filtered data that you want to save as csv file only, see screenshot:

doc save filtered data as csv 6

4. Then click OK button, and another box is popped out to remind you specify a file name and a location for your csv file, see screenshot:

doc save filtered data as csv 7

5. And then click Save button, only the filtered data is saved as csv file.


Kutools for Excel contains a useful tool-Export Range to File, it can help you export or save a range of selected cells to csv, pdf, text and other formatting files.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

After installing Kutools for Excel, please do as follows:

1. Select the filtered data to export.

2. Click Enterprise > Import / export > Export Range to File, see screenshot:

doc save filtered data as csv 8

3. In the Export Range to File dialog box, choose the file format that you want to save under the File format, then then click doc save filtered data as csv 10 button to select a folder to save the exported file, see screenshot:

doc save filtered data as csv 9

4. Then click Ok button, and another prompt box is popped out to remind you type a name for your exported file, see screenshot:

doc save filtered data as csv 11

5. And then click Ok, and only the selected filtered data has been saved as csv file as you need.

  Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.