Extracting Rows from a table based on list

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
785
Office Version
  1. 365
Platform
  1. Windows
Hi,
i am testing this currently with a large dataset (50000) rows and want to extract rows from a table based on a list of order IDs.

My Data table is stored in sheets("Data") - Columns A:N
OrderIDs are stored in column G

So if i have a list of OrderIDs in Sheet1, i want to extract all records where these orderIDs are found to Extract sheet

Not sure if an array is best for this? As i can store full table using:
Code:
Dim MyArray() As Variant
MyArray = Range("A2", Range("A1").End(xlDown).End(xlToRight))

Just unsure how to extract the orders quickly

screens
Sheet1: https://puu.sh/E17J6/396b48a352.png
Data: https://puu.sh/E17HE/98296f6512.png
Extract: [Expected] https://puu.sh/E17Jf/c3a34f8143.png


Any help appreciated
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How about
Code:
Sub JumboCactaur()
   Dim Critrng As Range
   
   With Sheets("Sheet1")
      Set Critrng = .Range("A1", .Range("A" & Rows.Count).End(xlUp))
   End With
   Sheets("Data").Range("A1").CurrentRegion.AdvancedFilter xlFilterCopy, Critrng, Sheets("Extract").Range("A1")
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,101
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top