+ Reply to Thread
Results 1 to 2 of 2

Macro Count Days Between Today's Date and Column D

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

    Macro Count Days Between Today's Date and Column D

    I am trying to have a loop look at every cell in column "D" (starting with D3), and count the number of days ago from today. Then I need this number to be placed into column "E" in the same row.



    The problem lies in the formula:
    = Cells(rIndex, "D").Value & Date - Today()



    Please Login or Register  to view this content.
    Last edited by Gard5096; 12-11-2012 at 06:57 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Macro Count Days Between Today's Date and Column D

    hi Gard5096. so you want a negative number? column D - today's date? switch it the other way round if you want a positive. from your formula, i see you are trying to use column D - Today. try amending it a little to:
    Please Login or Register  to view this content.
    also, i'm not sure why you had the "With" & "End With" for the sheet name. codes will run based on the current sheet you are selecting (aka the activesheet) if you did not indicate the sheet name. but if you had to run in another worksheet, you should use the "." in front of the Cells code to make it work. like this in red:
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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