+ Reply to Thread
Results 1 to 9 of 9

Insert Missing Dates

  1. #1
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Insert Missing Dates

    I am looking for help. Sheet1 B1:1 has dates in each column in ascending order for one month. There are missing dates in between the days and they might look like this.

    Example 1

    7/1/2009 7/2/2009 7/6/2009 7/7/2009

    Is there a code that will insert columns with the missing dates between the dates that already exist so that example 1 would become example 2?

    Example 2

    7/1/2009 7/2/2009 7/3/2009 7/4/2009 7/5/2009 7/6/2009 7/7/2009
    Last edited by Sal1; 08-06-2009 at 11:07 PM. Reason: SOLVED

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert Missing Dates

    Give this a try:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Insert Missing Dates

    This is great. Thank you. The only problem I am having is that once the dates are finished filling in for the current month, dates continue to be filled in for previous months. If it’s possible I would like to stop the code after the current month is completed.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert Missing Dates

    Show me the data you're dealing with. Click GO ADVANCED and use the paperclip icon to post up your workbook.

  5. #5
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Insert Missing Dates

    Thank you.
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert Missing Dates

    I added one line that should fix it:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Insert Missing Dates

    Wow. It works like a charm. Thanks man! Your help is very much appreciated.

  8. #8
    Registered User
    Join Date
    12-07-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Insert Missing Dates

    Hi,

    What would be the macro, if the same data is in rows....please help...thanks!

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Insert Missing Dates

    Vikram1009,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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