Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Struggling of Essex
 
Posts: n/a
Default 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   Report Post  
Don Guillett
 
Posts: n/a
Default

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   Report Post  
Struggling of Essex
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Excel how can a number automatically display in text form Curtis A Excel Worksheet Functions 2 February 26th 05 11:31 AM
Automatically number multiple sheets itguyintrainin Excel Discussion (Misc queries) 4 February 3rd 05 11:49 PM
how do I put a a sequence number into colun A automatically witho. Custodio Bernardes Excel Discussion (Misc queries) 2 January 2nd 05 11:30 PM
How to make Cells automatically become 'highlighted' when number . Kate Excel Worksheet Functions 2 November 25th 04 12:59 AM
How to make Cells automatically become 'highlighted' when number . Kateskyline Excel Worksheet Functions 1 November 24th 04 09:27 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"