Extracting Rows from a table based on list

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
788
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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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