+ Reply to Thread
Results 1 to 12 of 12

Auto Populating a Cell with a Date 15 days away

  1. #1
    Registered User
    Join Date
    08-07-2020
    Location
    LA
    MS-Off Ver
    2016
    Posts
    4

    Auto Populating a Cell with a Date 15 days away

    Hi All,

    I am new to the Excel VBA world and looking for some help with a simple macro that I would like to use on a Financial Document.

    I have been looking through internet forums for awhile now and haven't quite come across what I'm looking for yet.

    What I hope to accomplish is a macro, that when activated, will reference the next open cell in a column, then fill it with a date that is 14 days away from the date in the cell right above that new cell.

    I have attached an image of what I hope the finish copy will look like by just manually entering in dates to a column but I would love some help to get this into a working macro form!

    Thanks!

    CK
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    For clarification, are you looking for a button to be placed on a sheet then you want to select a new field. once the new field is selected, are you then looking to push that button and a date will show up in that selected cell that is 14 days from the date above it? Is that what you are looking for?

  3. #3
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    Just in case I was right in my interpretation, here is a working macro for you. just select one Space below a date, and the next 14 day value will populate.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by maniacb; 08-08-2020 at 10:16 AM. Reason: Add file

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Auto Populating a Cell with a Date 15 days away

    .
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-07-2020
    Location
    LA
    MS-Off Ver
    2016
    Posts
    4

    Re: Auto Populating a Cell with a Date 15 days away

    Hi Maniacb,

    Thank you for the macro! It was a good example to read through and implement, great for my learning. Your first assumption was very close. I was also interested in being able to just press a button at the top of the page and having it auto create a new line and add the next 14 day date after that (without me having to select that new line).

    Thank you again for the help!

    CK

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    @Cknutson575, i would like to help, but where do we know to create the new row in what column. Shall we assume that there is only one column on the page? Did you try @Logit's solution and did that one work? Thanks

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    Here is an update,

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-07-2020
    Location
    LA
    MS-Off Ver
    2016
    Posts
    4

    Re: Auto Populating a Cell with a Date 15 days away

    Maniacb,

    I havent yet tried logit's solution yet but I will tonight. I have attached some screen shots to this post labeled stage 1, stage 2, stage 3 in an attempt to illustrate what I would like to have happen after each button press. I would like everything to be fully automated except the actual dollar amounts that are input into the different categories.

    So things that I hope to automate are:
    Auto inserting a new row after each button press
    Auto filling a date on that new row in the date column
    Auto increasing the range of the sum calculation at the end of each category

    There may be some more nuances that I simply don't know because of my lack in knowledge but I hope to learn them from this small project.

    I really appreciate all the help.
    Attached Images Attached Images

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    @Cknutson575, can you upload your working file so we can incorporate your requirements, as per the yellow banner above. Thanks

  10. #10
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    Try this file, see if it meets your requests.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-07-2020
    Location
    LA
    MS-Off Ver
    2016
    Posts
    4

    Re: Auto Populating a Cell with a Date 15 days away

    Maniacb,
    This works perfectly! Thank you so much for the help. If it isnt too much would it be possible for you to add comments to the VBA code so that I can learn what you are doing with each command? I am trying to recreate this by myself to learn and I think I am following what you are doing but I would appreciate the comments to confirm my learning.
    Thank you!

  12. #12
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Auto Populating a Cell with a Date 15 days away

    Here is the code commented for you:

    Please Login or Register  to view this content.
    This code works with the spreadsheet sum() formula by always entering a new line/row in the existing summation.

+ 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. Auto populating date/time
    By severett2 in forum Excel General
    Replies: 1
    Last Post: 06-28-2018, 02:48 AM
  2. [SOLVED] Date (Year) Stopped Auto Populating
    By Bigsur in forum Excel General
    Replies: 3
    Last Post: 02-22-2018, 02:11 PM
  3. [SOLVED] Date auto-populating by sequence number...
    By JRR007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-09-2017, 02:08 PM
  4. Replies: 1
    Last Post: 05-26-2014, 03:46 AM
  5. Auto Populating Cells From A Date Range
    By vuyyuru in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-01-2011, 04:44 PM
  6. Auto Populating Cells From A Date Range
    By vuyyuru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2011, 03:36 AM
  7. [SOLVED] Auto populating date field
    By TimM in forum Excel General
    Replies: 1
    Last Post: 06-19-2006, 12:55 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