This article demonstrates how to export SharePoint Filtered list items to Excel. SharePoint gives an option out of the box to export SharePoint views directly, however, if we apply any filter on the SharePoint view and then export the SharePoint list then instead of the filtered view we get all the results in the view in Excel. Hence, to just get those filtered items in Excel we add a content editor web part and link it with our code to export filtered items.SharePoint-2013-Hosting

To export only filtered list items in a SharePoint view to Excel

Firstly create a .txt file and paste the following code in the txt file. You can name the file as ExportToExcel.txt.

Now, upload this file to Site Assets library in SharePoint.

Go to the list view in SharePoint where you would like to filter the list view and then click on Edit Page as shown in the screenshot below.

Then, click on Add a Web part >> Media And Content >> Content Editor and then click on Add button as shown in the image below.

After adding the web part click on the Down Arrow and then click on Edit Web Part as shown in the screenshot below.

Scroll to the right of the page and in the Content Link property paste the link of the txt file that was uploaded to the Site Assets Gallery, namely ExporttoExcel.txt and then click OK.

Now, you will see  Export to Excel button on the list. Now if you filter the list and then click on “Export to Excel” button Excel will be downloaded with only filtered view records that are visible on the screen. In this article, we discussed how we can export SharePoint Filtered Items to Excel. This is of great help as we can directly export filtered view items which are currently not provided by SharePoint out of the box features.