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:

datenamecost ($)
1/07/2015 CSG Business Solutions Pty Ltd212.84
17/07/2015 Kingstar Australia109.09
1/08/2015 CSG Business Solutions Pty Ltd119.29
7/08/2015 Kingstar Australia78.18
17/08/2015 Pure Colours Digital Imaging95.00
1/09/2015 CSG Business Solutions Pty Ltd154.67
24/09/2015 Kingstar Australia146.39
28/09/2015 Cash49.09
1/10/2015 CSG Business Solutions Pty Ltd185.78
12/10/2015 Kingstar Australia61.00
29/10/2015 Kingstar Australia83.64
1/11/2015 CSG Business Solutions Pty Ltd251.41
1/11/2015 Kwik Kopy Printing124.00
5/11/2015 Kingstar Australia78.18
25/11/2015 Cash11.77
27/11/2015 Kingstar Australia220.58
1/01/2016 CSG Business Solutions Pty Ltd151.57
25/01/2016City Stationery Office10.54
27/01/2016 Cash24.55
29/01/2016 Pure Colours Digital Imaging95.00
1/02/2016 CSG Business Solutions Pty Ltd153.73
17/02/2016 Kingstar Australia20.18

<colgroup><col><col><col></colgroup><tbody>
</tbody>
<strike></strike>

 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,215,046
Messages
6,122,849
Members
449,096
Latest member
Erald

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