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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

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