+ Reply to Thread
Results 1 to 4 of 4

Loop for "E3" = "D3" + 30 Days

  1. #1
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Post Loop for "E3" = "D3" + 30 Days

    I am trying to make a loop fill in all cells in column E (starting with row 3) with the date in column D plus 30 days. For example: If D3 = 12/1/12, then E3 = 12/31/12.

    Here is what I have so far. The part where it gets tricky is :

    = Cells(rIndex, "D" & Date + 30).Value
    Please Login or Register  to view this content.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Loop for "E3" = "D3" + 30 Days

    Please Login or Register  to view this content.
    You'll also need to format the cells as date afterwards. You can do that in the macro by using the Range().NumberFormat = "m/d/yy"
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Loop for "E3" = "D3" + 30 Days

    Just fix the line as follows:

    Cells(rIndex, "E").Value = Cells(rIndex, "D").value + 30

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Loop for "E3" = "D3" + 30 Days

    That being said, I'd recommend using this way instead of a loop:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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