+ Reply to Thread
Results 1 to 4 of 4

Automatically creating the correct number of dated columns

Hybrid View

  1. #1
    Struggling of Essex
    Guest

    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. #2
    Don Guillett
    Guest

    Re: Automatically creating the correct number of dated columns

    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
    donaldb@281.com
    "Struggling of Essex" <StrugglingofEssex@discussions.microsoft.com> wrote in
    message news:54D22DFD-9909-42FF-B717-EEA768F8E8B1@microsoft.com...
    > 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. #3
    Struggling of Essex
    Guest

    Re: Automatically creating the correct number of dated columns

    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
    > donaldb@281.com
    > "Struggling of Essex" <StrugglingofEssex@discussions.microsoft.com> wrote in
    > message news:54D22DFD-9909-42FF-B717-EEA768F8E8B1@microsoft.com...
    > > 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?

    >
    >
    >


  4. #4
    Don Guillett
    Guest

    Re: Automatically creating the correct number of dated columns

    just change to
    sd=range("a1")
    ed=

    You do not place the code ON the sheet. You put it into a macro module.

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Struggling of Essex" <StrugglingofEssex@discussions.microsoft.com> wrote in
    message news:BF809717-79E9-464F-A7C3-21A1D2809660@microsoft.com...
    > 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
    > > donaldb@281.com
    > > "Struggling of Essex" <StrugglingofEssex@discussions.microsoft.com>

    wrote in
    > > message news:54D22DFD-9909-42FF-B717-EEA768F8E8B1@microsoft.com...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1