vba arrangement of data

uti1301

New Member
Joined
Jul 17, 2017
Messages
18
I have a file with 3 columns consisting of dates, companynames and costs respectively.
I have developed a VBA forecasting model which I want to useon this data.
However I want to arrange the data into the form I need,which is 2 columns consisting of months and costs, but with the rows of thecolumns containing:
Monthly costs on a separate worksheet named “monthly costs”
Quarterly costs on a separate worksheet named “quarterlycosts”
Also, some of the months may have no costs. It is importantin this case to include zero costs for these months.
All this is easy to do in Excel using filtering, andincluding zero costs manually.
However I would like to use a VBA macro to arrange the databecause the number of rows can vary, and months with zero costs could bemissed.
I have tried to write a macro to do this but have not beensuccessful.
I would be very grateful if you could solve my problem forme.

A sample of the data is:

[TABLE="width: 331"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]date[/TD]
[TD]name[/TD]
[TD]cost ($)[/TD]
[/TR]
[TR]
[TD]1/07/2015[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]212.84[/TD]
[/TR]
[TR]
[TD]17/07/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]109.09[/TD]
[/TR]
[TR]
[TD]1/08/2015[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]119.29[/TD]
[/TR]
[TR]
[TD]7/08/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]78.18[/TD]
[/TR]
[TR]
[TD]17/08/2015[/TD]
[TD] Pure Colours Digital Imaging[/TD]
[TD]95.00[/TD]
[/TR]
[TR]
[TD]1/09/2015[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]154.67[/TD]
[/TR]
[TR]
[TD]24/09/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]146.39[/TD]
[/TR]
[TR]
[TD]28/09/2015[/TD]
[TD] Cash[/TD]
[TD]49.09[/TD]
[/TR]
[TR]
[TD]1/10/2015[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]185.78[/TD]
[/TR]
[TR]
[TD]12/10/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]61.00[/TD]
[/TR]
[TR]
[TD]29/10/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]83.64[/TD]
[/TR]
[TR]
[TD]1/11/2015[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]251.41[/TD]
[/TR]
[TR]
[TD]1/11/2015[/TD]
[TD] Kwik Kopy Printing[/TD]
[TD]124.00[/TD]
[/TR]
[TR]
[TD]5/11/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]78.18[/TD]
[/TR]
[TR]
[TD]25/11/2015[/TD]
[TD] Cash[/TD]
[TD]11.77[/TD]
[/TR]
[TR]
[TD]27/11/2015[/TD]
[TD] Kingstar Australia[/TD]
[TD]220.58[/TD]
[/TR]
[TR]
[TD]1/01/2016[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]151.57[/TD]
[/TR]
[TR]
[TD]25/01/2016[/TD]
[TD]City Stationery Office[/TD]
[TD]10.54[/TD]
[/TR]
[TR]
[TD]27/01/2016[/TD]
[TD] Cash[/TD]
[TD]24.55[/TD]
[/TR]
[TR]
[TD]29/01/2016[/TD]
[TD] Pure Colours Digital Imaging[/TD]
[TD]95.00[/TD]
[/TR]
[TR]
[TD]1/02/2016[/TD]
[TD] CSG Business Solutions Pty Ltd[/TD]
[TD]153.73[/TD]
[/TR]
[TR]
[TD]17/02/2016[/TD]
[TD] Kingstar Australia[/TD]
[TD]20.18[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>

 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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