Parsing Data in chunks! HELP ME!

pablorynx

New Member
Joined
Nov 22, 2003
Messages
3
I'm trying to write a macro which will parse out chunks of data from a dataset, based on criteria within the datachunk.
My data goes from A1:C10
the data in A1:A10 is one of five different labels
the data in B1:B10 is one of nine different labels
How can I get all the data in my chunk where the data in column A equals a particular element and the data in column B equals a particular element, and copy-paste it to another sheet? I can get the sheet sorted first by the elements in column A, then in column B. But I can't figure out how to transfer the data parsed out in such a fashion. Does anyone out there have a clue?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
pablorynx said:
I'm trying to write a macro which will parse out chunks of data from a dataset, based on criteria within the datachunk.
My data goes from A1:C10
the data in A1:A10 is one of five different labels
the data in B1:B10 is one of nine different labels
How can I get all the data in my chunk where the data in column A equals a particular element and the data in column B equals a particular element, and copy-paste it to another sheet? I can get the sheet sorted first by the elements in column A, then in column B. But I can't figure out how to transfer the data parsed out in such a fashion. Does anyone out there have a clue?

I'm assuming you want to lookup the value in column C based on A and B.

Insert a column in front of column A and enter the following formula in A1
=B1&C1. This creates a unique index based on column B & C. This will move your data to B1:D10

On your second sheet I'm assuming you have the values of column B & C and want to value from D from your original sheet.

Use a vlookup
=Vlookup(A1&B1,$A$1,$D$10,4,false) where A1 & B1 is your unique index values and copy this formula down as needed.

Hope this helps.
 
Upvote 0

pablorynx

New Member
Joined
Nov 22, 2003
Messages
3
Thanks, although I was looking for someway to do this in VBA. I need to do this quite a bit, so an automated solution via VBA code would be extremely much more helpful.
 
Upvote 0

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
While not a VBA solution, you could use advanced data filters where you send the data to another location. Maybe try doing this once and record it and then tweak the resulting macro?
 
Upvote 0

Forum statistics

Threads
1,195,680
Messages
6,011,126
Members
441,586
Latest member
rodsin76

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
Top