Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Automatically creating the correct number of dated columns
I wish to set up a cashflow spread sheet that has a basic data front sheet.
This basic data would include a commencement date and a completion date for the cashflow. Typically these cashflows would be 36 - 60 months long, therefore requiring the requisit number of columns to be created and headed with the date reference; namely January 05, February 05, ect. etc. Can anyone help? |
#2
|
|||
|
|||
try this
Sub setmonths() Dim sd As Date Dim ed As Date sd = InputBox("Enter start date") ed = InputBox("Enter stop date") For i = 1 To DateDiff("m", sd, ed) + 1 Cells(1, i) = sd - 30 + (i * 30) Cells(1, i).NumberFormat = "mmm yy" Next i End Sub -- Don Guillett SalesAid Software "Struggling of Essex" wrote in message ... I wish to set up a cashflow spread sheet that has a basic data front sheet. This basic data would include a commencement date and a completion date for the cashflow. Typically these cashflows would be 36 - 60 months long, therefore requiring the requisit number of columns to be created and headed with the date reference; namely January 05, February 05, ect. etc. Can anyone help? |
#3
|
|||
|
|||
Don,
Thanks for this steer, however I need a little more guidance. If I input the start date and end date on sheet 1, do I place the code on the sheet upon which I which to create the cash flow? Thanks "Don Guillett" wrote: try this Sub setmonths() Dim sd As Date Dim ed As Date sd = InputBox("Enter start date") ed = InputBox("Enter stop date") For i = 1 To DateDiff("m", sd, ed) + 1 Cells(1, i) = sd - 30 + (i * 30) Cells(1, i).NumberFormat = "mmm yy" Next i End Sub -- Don Guillett SalesAid Software "Struggling of Essex" wrote in message ... I wish to set up a cashflow spread sheet that has a basic data front sheet. This basic data would include a commencement date and a completion date for the cashflow. Typically these cashflows would be 36 - 60 months long, therefore requiring the requisit number of columns to be created and headed with the date reference; namely January 05, February 05, ect. etc. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
In Excel how can a number automatically display in text form | Excel Worksheet Functions | |||
Automatically number multiple sheets | Excel Discussion (Misc queries) | |||
how do I put a a sequence number into colun A automatically witho. | Excel Discussion (Misc queries) | |||
How to make Cells automatically become 'highlighted' when number . | Excel Worksheet Functions | |||
How to make Cells automatically become 'highlighted' when number . | Excel Worksheet Functions |