+ Reply to Thread
Results 1 to 3 of 3

Changing date to next day based on previous cell

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Changing date to next day based on previous cell

    Greetings All,

    I very much plan on being a part of this community once I start getting good at this stuff. Right now I have a worksheet (action sheet) that can pick out dates in columns A and E. All these dates are in sequential order from left to right and top to bottom. What I am looking to do (though VBA) is if a row is inserted, and new sequential dates are added, all the dates afterwards will update to the next corresponding day. I know this sounds confusing so I will attach the spreadsheet to show you what I mean. Thanks for you help (you awesome awesome people in the internets).
    Project Team Control Document4.xlsm

    (Edit) Going to edit the post as a gain more progress. Here is what I'm aiming for:
    Sub DATEADD()
    If (A7 < E6) Then
    A7 = DATEADD("d", 1, CDate(E6))

    End If

    End Sub
    I know this looks basic compared to the rest of that worksheet but much of that worksheet was copy and pasting.

    Edit2:
    A pic to show what I mean:
    worksheet display.jpg
    Last edited by Willmannyeatthat; 03-20-2012 at 10:20 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: Changing date to next day based on previous cell

    I don't think you use Cell references that way. Use the Range object.

    Please Login or Register  to view this content.
    In stead of hard coding the cells like this, why not just re-sequence all the dates

    Like this;

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-20-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Changing date to next day based on previous cell

    Thank you for the speedy reply. I can't say that I fully understand what re-sequencing would do but I do need it to be dynamic enough to be able to change if the date were to change. The dates will change often so that is why I opted on using the cell values.

+ 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