+ Reply to Thread
Results 1 to 11 of 11

Filling in dates

  1. #1
    Registered User
    Join Date
    03-31-2008
    Posts
    15

    Filling in dates

    I have a form where dates are entered, start dates and end dates, in column A and B. Four scenarios can be entered at once. What I need is for the entire date range to be displayed in column C.
    Example: if I enter 1 January 2008 as a start date in A2 and 5 January 2008 as end date in B2, then I need 1 January 2008, 2 January 2008, 3 January 2008, 4 January 2008 and 5 January 2008 to be automatically entered into C2:C6. If I then enter 10 January 2008 as a start date in A3 and 12 January 2008 as end date in B3, then 10 January 2008, 11 January 2008 and 12 January 2008 is automatically entered into the next empty cell in column C, in this case C7:C9, etc. If I change or delete any of the start and end dates then the date range in column C must be automatically updated. It doesn't have to be in any order, as long as the date are reflected somewhere in column C, and deleted if the start/end dates are removed. I hope someone can help me with this issue.

    Thanks in advance for any help this community can provide.
    Attached Files Attached Files

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon anita.r

    ...and welcome to the forum!!

    Does this macro solve your problem :
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    03-31-2008
    Posts
    15
    Thanks for the fast reply, the macro doesn't seem to be doing exactly what I need, it isn't filling in column C and then doesn't remove dates after updating the start and end dates.

  4. #4
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Please Login or Register  to view this content.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi anita.r
    Quote Originally Posted by anita.r
    ...it isn't filling in column C...and then doesn't remove dates after updating the start and end dates...
    Whoops! Iset it to go horizontally, instead of down. Try this modification :
    Please Login or Register  to view this content.
    HTH

    DominicB

  6. #6
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-31-2008
    Posts
    15
    Thanks DominicB. That works great! Just one little modification I need, the macro deletes all data in column C when there are no start or end dates, is it possible to delete only the relevant dates?

  8. #8
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi anita.r

    What do you mean by "relevant dates"?

    DominicB

  9. #9
    Registered User
    Join Date
    03-31-2008
    Posts
    15
    There may be other data in column C that must not be deleted.

  10. #10
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi anita.r

    This modified code will do the trick as long as there is a gap of at least one cell between the bottom of the dates and the information that should not be deleted. Is this going to be the case?

    Please Login or Register  to view this content.
    HTH

    DominicB

  11. #11
    Registered User
    Join Date
    03-31-2008
    Posts
    15
    That will work for me, 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