Macro help - to retrieve rows based on specific cell values in a column

Nowherefast

New Member
Joined
May 18, 2009
Messages
23
Hello:

I need some assistance. I am trying to retrieve rows of data based on specific values of a column (field 15). I wrote a macro (see below - I only copied a few UPC items) by using Filter and then I was going to input the remaining UPC item values, but it's over 100 and I ran out of room in the line item. I am unable to figure out how to continue onto the next line item so I can proceed to input the remaining UPC items.

My file has over 65,000 rows and can vary from week to week but no higher than 75,000 and I need to retrieve approx 100 UPC items into another sheet or file every week.

Please see below and advise. Thank you.





Sub MacroUPC()
'
' MacroUPC Macro
'


'
ActiveSheet.Range("$A$1:$BP$80000").AutoFilter Field:=15, Criteria1:=Array( _
"00020842055563", "00034000631506", "00037795111147", "00071818302310"), Operator _
:=xlFilterValues

End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
How did you decide on these numbers:
00020842055563
00034000631506

etc. etc.
We should let the script make the decision on what numbers. What was your logic on choosing these numbers?
 
Upvote 0
Hello "My Aswer Is This"....I have a list of over 100 numbers that I need to retrieve from...those 4 are just the first 4 of the list...I'm only able to fit about 60 or so numbers to the macro script
 
Upvote 0
So I'm guessing then there is no logic how you come up with these 100 or more values to look for.
See sometimes people would say if the quantity in column "C" is less then 4 copy this row to other sheet.
But in your case we would have to look through all 65,000 rows for "1005647" and then look through all 65,000 rows for "10612456" and on and on.

I have no easy solution for that.

You may also want to point out where you want these rows retrived to:

We normally need both sheet names.

But I'm sure someone else here at Mr. Excel will have an answer for you. Just check back in here every couple hours.
 
Upvote 0
Thank you for your time, but just to close this out, I ended up going the easier route and moving the file to Access, then do a simple query to output the 100 plus UPC numbers into one query table and then creating a macro to run that query, export to excel, name it and move to a specific folder and that's that...Thanks again for your input
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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