+ Reply to Thread
Results 1 to 4 of 4

Fill dates across

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Fill dates across

    I have a formula on one sheet which finds the date of the first Monday in April of a chosen year.
    I want to copy this date to a second sheet and then fill across for all the days of that year (April to April).
    I have not been able to solve this problem and would welcome some help.
    I want, eventually, to automate this process in VBA
    John

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Fill dates across

    Copy paste as value. Then copy across. It will auto increment by 1 day per cell.

    If you mean that you want to create array. You can do something like...
    Please Login or Register  to view this content.
    Note: I took across to mean dates in columns. If you mean to rows, then just use Application.Transpose(ar).
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Fill dates across

    Put your formula on the second sheet in the cell you want to start from, let's say cell B1 for example purposes, then put this formula in the next cell to the right (cell C1 for this example)...

    =B1+1

    and copy that cell to the right 363 columns (that would be cell NB1 for this example). Finally, put this formula in the next cell over (cell NC1 for this example) in order to handle Leap Years correctly...

    =IF(MONTH(DATE(YEAR(NB1),2,29))<>2,"",NB1+1)
    Last edited by Rick Rothstein; 09-30-2019 at 10:57 AM.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Fill dates across

    If you wanted a macro solution like CK76 has posted (instead of the formula solution I gave you above), you can consider this one as well...
    Please Login or Register  to view this content.
    NOTE: The above code assumes the start date is taken from cell A1 on Sheet 1... change as required or, if desired, hard-code the date directly.
    Last edited by Rick Rothstein; 09-30-2019 at 11:55 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Fill down dates
    By wildgoosed in forum Excel General
    Replies: 2
    Last Post: 12-02-2013, 07:35 PM
  2. Replies: 3
    Last Post: 02-09-2012, 06:57 PM
  3. Excel 2007 : Fill gap between dates
    By Amalaswinta in forum Excel General
    Replies: 6
    Last Post: 05-28-2011, 10:15 AM
  4. Replies: 1
    Last Post: 05-27-2010, 12:32 PM
  5. Between dates\fill-in?
    By flysim in forum Excel General
    Replies: 1
    Last Post: 02-11-2010, 01:53 PM
  6. [SOLVED] Auto fill for dates?
    By George in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2006, 11:55 PM
  7. [SOLVED] RE: Auto fill dates
    By Jennifer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-24-2006, 03:35 PM
  8. dates - automatically fill next day
    By small tom in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-06-2005, 04:05 PM

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