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>
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>