ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trying to create a blow-up sheet by writing a VBA macro (https://www.excelbanter.com/excel-programming/325655-trying-create-blow-up-sheet-writing-vba-macro.html)

Dono

trying to create a blow-up sheet by writing a VBA macro
 
Hello I am trying to create a blow-up sheet by writing a VBA macro that shows
the initial cost buy of an item then for a range of years, the Maintenance
cost for each year.
e.g.
PC Cost by is $2000 bought on 4/2005 and for the next 4 years the
maintanence cost is $100 per year.
so it should appear as:

PC $2000 4/2005
PCmaint $100 4/2006
PCmaint $100 4/2007
PCmaint $100 4/2008
PCmaint $100 4/2009

I imagine it will be a FOR or WHILE with some ARRAY type variable

Thanks


K Dales[_2_]

trying to create a blow-up sheet by writing a VBA macro
 
The answer to your question depends very much on where the source data is,
how it is arranged, etc. Need more detail to be of help, I'm afraid.

"DONO" wrote:

Hello I am trying to create a blow-up sheet by writing a VBA macro that shows
the initial cost buy of an item then for a range of years, the Maintenance
cost for each year.
e.g.
PC Cost by is $2000 bought on 4/2005 and for the next 4 years the
maintanence cost is $100 per year.
so it should appear as:

PC $2000 4/2005
PCmaint $100 4/2006
PCmaint $100 4/2007
PCmaint $100 4/2008
PCmaint $100 4/2009

I imagine it will be a FOR or WHILE with some ARRAY type variable

Thanks


Dono

trying to create a blow-up sheet by writing a VBA macro
 
Hello K Dales, I hope this helps so here it goes
The Data is entered into a Contract Input sheet as (start and end dates are
start and end of the contract) follows:

QTY ITEM CostBuy CostofMaintenance(per Yr) Startmonth/Yr Endmonth/yr
5 PC $2000 $100 5/2005
6/2009


The following is a rough algorithm of calculating the Buy Cost and the
maintenance

CostToBuy = CostBuy * QTY then

' For MaintYear = ActualStartDate To ActualEndDate
' Cost Maint * QTY * (ActualStartDate)
' + (["Desktop HW Input" sheet] Contract Structure
' + ["Desktop HW Input" sheet] Maint End)
' next i


The first line(Row) that will be output will be the "Cosbuy" as follows:

PC - Buy $2000

The next lines shout output as:
PC-Maint $100 5/2006
PC-Maint $100 5/2007
PC-Maint $100 5/2008
PC-Maint $100 5/2009

I hope this makes sense signed desperate and confused!!!

"K Dales" wrote:

The answer to your question depends very much on where the source data is,
how it is arranged, etc. Need more detail to be of help, I'm afraid.

"DONO" wrote:

Hello I am trying to create a blow-up sheet by writing a VBA macro that shows
the initial cost buy of an item then for a range of years, the Maintenance
cost for each year.
e.g.
PC Cost by is $2000 bought on 4/2005 and for the next 4 years the
maintanence cost is $100 per year.
so it should appear as:

PC $2000 4/2005
PCmaint $100 4/2006
PCmaint $100 4/2007
PCmaint $100 4/2008
PCmaint $100 4/2009

I imagine it will be a FOR or WHILE with some ARRAY type variable

Thanks



All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com