+ Reply to Thread
Results 1 to 6 of 6

Take user input start date and end date. Create a column for each month between these

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Take user input start date and end date. Create a column for each month between these

    Ok, So I have a worksheet where the user inputs a start date in cell a2 and an end date in cell b2

    I need to work out the months this covers. So for example 01/01/2010 - 31/12/2010 and then put a column heading in for each month starting in B4 and going across that row for however many columns i need.

    So in this case I would have Jan-2010 in B4, Feb-2010 in C4 and so on up until Dec 2010 in the last column.

    Can anyone give me pointers on how to do this in VBA. I also need to be able to use the calculated months in sql queries so it would be good if I could have another row below the headings with the date range in date format So b4 would be Jan-2010. b5 would be 01/01/2010 - 31/01/2010.

    Any help would be greatly appreciated

    Thanks
    Last edited by TheCyrusVirus; 05-07-2010 at 11:45 AM. Reason: solved

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Take user input start date and end date. Create a column for each month between t

    Hi, Try this:-
    Remove the "Chr(10) & one "Ampersand" sign if you don't want the Dates Wrapped.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Take user input start date and end date. Create a column for each month between t

    Thanks Mick

    Works like a charm. I always fall over when working with dates in Excel.

    Much appreciated.

  4. #4
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Take user input start date and end date. Create a column for each month between t

    How do I mark this as solved?

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Take user input start date and end date. Create a column for each month between t

    Go to the first post in the thread and click on EDIT --> ADVANCED and at the top next to your TITLE there will be a dropdown menu with one the options being [SOLVED].

    Good luck

    abousetta

  6. #6
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Take user input start date and end date. Create a column for each month between t

    Thanks very much

+ 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