Note: The other languages of the website are Google-translated. Back to English

如何在Excel中使用“高級篩選器”將數據複製到另一個工作表?

通常,我們可以快速應用 進階篩選 此功能可從同一工作表中的原始數據中提取數據。 但是,有時,當您嘗試將篩選的結果復製到另一個工作表時,會收到以下警告消息。 在這種情況下,您如何在Excel中處理此任務?

通過使用高級篩選器功能將數據複製到另一個工作表與高級篩選器

使用VBA代碼使用高級篩選器將數據複製到另一個工作表


通過使用高級篩選器功能將數據複製到另一個工作表與高級篩選器

這是您解決此問題的簡單解決方法,請按照以下步驟操作:

1。 通過使用“高級篩選器”功能激活要在其中復制篩選結果的工作表。

2。 然後點擊 數據 > 高級,請參見屏幕截圖:

3。 在 進階篩選 對話框中選擇 複製到另一個位置 來自 行動 部分,然後單擊 按鈕以選擇要在另一張表中過濾的數據范圍 清單範圍,繼續點擊 按鈕旁邊的按鈕 條件範圍 要從另一張表中選擇條件,請參見屏幕截圖:

4。 然後點擊 按鈕旁邊的按鈕 複製到 框中選擇一個單元格,要在其中從活動工作表中輸出過濾的結果,然後單擊 OK 按鈕,已過濾的結果已基於您的原始數據表提取到另一張表中。


使用VBA代碼使用高級篩選器將數據複製到另一個工作表

如果您精通VBA代碼,則可以使用以下VBA代碼完成此工作。

1。 激活要過濾的工作表,然後將結果復製到另一張表。

2。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

3。 點擊 插入 > 模塊,然後將以下代碼粘貼到 模塊 窗口。

VBA代碼:使用高級過濾器將數據複製到另一個工作表:

Sub Advancedfiltertoanothersheet()
'Updateby Extendoffice
    Dim xStr As String
    Dim xAddress As String
    Dim xRg As Range
    Dim xCRg As Range
    Dim xSRg As Range
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the filter range:", "Kutools for Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xCRg = Application.InputBox("Please select the criteria range:", "Kutools for Excel", "", , , , , 8)
    If xCRg Is Nothing Then Exit Sub
    Set xSRg = Application.InputBox("Please select the output range:", "Kutools for Excel", "", , , , , 8)
    If xSRg Is Nothing Then Exit Sub
    xRg.AdvancedFilter xlFilterCopy, xCRg, xSRg, False
    xSRg.Worksheet.Activate
    xSRg.Worksheet.Columns.AutoFit
End Sub

4. And then press F5 key to run this code, and a prompt box is popped out to let you select the data range that you want to filter, see screenshot:

5. Then click OK, and another dialog box is popped out to remind you to select the criteria range you want to filter based on, see screenshot:

6. Go on clicking OK, in the popped out dialog box, please select a cell from another new worksheet where you want to output the filter result, see screenshot:

7. At last, click OK button, the filtered data has been outputted into another specified sheet as you need.


The Best Office Productivity Tools

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-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
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
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
No funciona, sigue el mismo mensaje de error....
There are no comments posted here yet

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL