Help with data manipulation macro

DavidH

New Member
Joined
Mar 3, 2002
Messages
28
I'm trying to write a macro that can help me with the following situation.

Here's a simplified version of a sheet I have in an Excel workbook:

Region Vendor Month Amount
North IBM Jan 13.11
North Dell Feb 11.66
North Dell Feb 12.28
North Dell Jan 11.09
North Apple Feb 16.01
South Gateway Jan 18.37
South Gateway Jan 11.44
South Gateway Feb 11.09
South Dell Feb 17.40
South Dell Feb 12.87
South Dell Jan 17.10
South Dell Jan 12.74
East Sun Jan 14.42
East Sun Feb 17.53
East Dell Jan 15.35
East Dell Feb 12.51
West HP Feb 10.67
West Compaq Feb 17.21

I need to manipulate the data as follows:

Set up a worksheet for each region (e.g. one worksheet for North, one for South, etc.)

Rearrange the data into this format:
In the North sheet:

Vendor Jan Feb Total
Apple - 16.01 16.01
Dell 11.09 23.94 35.03
IBM 13.11 - 13.11
Total 24.20 39.95 64.15

In the East sheet:

Vendor Jan Feb Total
Sun 14.42 17.53 31.95
Dell 15.35 12.51 27.86
Total 29.77 30.04 59.81

The number of vendors in each region can vary significantly from month to month. New regions also may be added from time to time.
I've worked out how to get my macro to insert a worksheet for each region, but I'm having trouble getting the data crosstabbed into the format I need. Any suggestions?

Thanks in advance for any help you can provide!

David
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,371
Messages
6,171,689
Members
452,418
Latest member
kennettz

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