+ Reply to Thread
Results 1 to 7 of 7

Excel Macro to find missing dates and insert missing date as blank row

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    Vermont, US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Excel Macro to find missing dates and insert missing date as blank row

    Hi,

    I have a large spreadsheet with climate data by day. I am re formatting the spreadsheet so that the stations are columns and all the dates from 1884 to 2012 are rows. There are some missing dates and I would like to insert black rows for the missing dates for each station. I have been filtering the data to isolate each station.

    Any ideas?
    Thanks!

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Excel Macro to find missing dates and insert missing date as blank row

    try the following macro:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Excel Macro to find missing dates and insert missing date as blank row

    It's hard to see exactly what you want without a sample spreadsheet, but maybe if you run this code on some test data to see if it's on the right track. This assumes no column header. May give error if you do have a column header, but very easily remedied.
    Please Login or Register  to view this content.
    Last edited by kalak; 06-26-2013 at 03:47 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Excel Macro to find missing dates and insert missing date as blank row

    hmm ...
    minor problem in my code posted above.
    please substitute this one instead
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    Vermont, US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel Macro to find missing dates and insert missing date as blank row

    Thanks,

    I get an error at the No_Row_To_Add line

  6. #6
    Registered User
    Join Date
    06-25-2013
    Location
    Vermont, US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel Macro to find missing dates and insert missing date as blank row

    SAMPLE_VT_NCDC .xlsx

    Attached is some sample data.

    Thanks for the help

  7. #7
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Excel Macro to find missing dates and insert missing date as blank row

    Where are the dates? Which column?

+ 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