+ Reply to Thread
Results 1 to 4 of 4

Macro that adds 1 to previous day but stops when following day isnt the same

  1. #1
    Registered User
    Join Date
    05-18-2015
    Location
    America
    MS-Off Ver
    MS Office 2010
    Posts
    23

    Macro that adds 1 to previous day but stops when following day isnt the same

    I have data:

    4/22/16
    4/22/16
    4/22/16
    4/22/16
    11/13/20
    11/13/20
    5/14/16
    5/14/16
    5/14/16
    5/14/16
    5/14/16
    5/14/16
    5/14/16


    This is just a sample of hundreds lines of data. How would I create a macro that lets me add a day to the previous day before it (but stops when the following day isn't the same ? and then contines to the next line) So, I would want
    4/22/16
    4/23/16
    4/24/16
    4/25/16
    11/13/20
    11/14/20
    5/14/16
    5/15/16 and etc...

  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: Macro that adds 1 to previous day but stops when following day isnt the same

    Like so:

    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
    05-18-2015
    Location
    America
    MS-Off Ver
    MS Office 2010
    Posts
    23

    Re: Macro that adds 1 to previous day but stops when following day isnt the same

    Thank you so much! This works perfectly!

  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: Macro that adds 1 to previous day but stops when following day isnt the same

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

+ 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. Replies: 2
    Last Post: 07-02-2013, 07:03 AM
  2. Help creating a macro that adds the previous day's data into a monthly column.
    By MonaHussain in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2012, 08:44 AM
  3. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  4. Cell adds previous values automatically
    By nih in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-20-2009, 10:38 AM
  5. [SOLVED] entering a # each row adds 1 to the previous cell. Turn off?
    By dbog in forum Excel General
    Replies: 1
    Last Post: 11-20-2005, 02:45 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