sorting data into specified worksheets...

nathanstevens

New Member
Joined
May 18, 2003
Messages
13
Hi,

I am trying to assign a macro in excel that inserts a row of data into a specified worksheet based on the region column. So basically, I have a report of data from many regions that I would like to filter out into their appropriate worksheets based on the record region. I haven't had much to do with excel macros before, only java, so I am not sure of the syntax however here is what I want to do in psuedo code to give you a better idea of what I want to achieve...

if (column(region) = "region1") then
paste this row into the "region1" worksheet
if (column(region) = "region2") then
paste this row into the "region2" worksheet...and so on.

Any help in this matter would be greatly appreciated. The macro will be assigned to a button named "Distribute Data" that will be seen from the worksheet with all the raw data on it.

Thanks in advance.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I quick workaround I use in this case is to create a pivot table.
Group the data by region.

Tehn double click the entry for a region. A new worksheet will automagically be created showing the data for that entry only.

It is a nice drill down feature that pivot tables have, but is also a good way to consoldiate and sort data in this sort of instance as no macro is necessary.
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,322
Members
451,696
Latest member
Senthil Murugan

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