So I have a fairly long piece of code, the result of which is always subracting one date from another. I want it to display the number of days between today and a certain date. Here is the code I'm using now:
Sometimes this works, but a lot of the time it will display the number in date form. So if I want it to read "9" it will sometimes show 1/9/1900 or whatever the corresponding date would be in the Excel date index. Is there a way I can code it so it always shows the number of days between today and the date instead of showing the date from the Excel date index? I formatted the cell to general, but it still sometimes shows a date there instead of a number.
Any help you can provide me with is greatly appreciated.
Thanks!
Hank
Code:
Abs(Int(Now) - ActiveSheet.Range("K" & r).Value)
Sometimes this works, but a lot of the time it will display the number in date form. So if I want it to read "9" it will sometimes show 1/9/1900 or whatever the corresponding date would be in the Excel date index. Is there a way I can code it so it always shows the number of days between today and the date instead of showing the date from the Excel date index? I formatted the cell to general, but it still sometimes shows a date there instead of a number.
Any help you can provide me with is greatly appreciated.
Thanks!
Hank