July 13th, 2014, 02:54 PM
So I need some help debugging some code. I'm trying to create a macro that updates the years since a date that is given in column 16 of each row then placing that number of years in row Sub dateUpD8()
x = 3
Do Until Cells(x, 16).Value = ""
d = Cells(x, 16).Value
fromDate = CDate(d)
toDate = CDate(Now)
Cells(x, 27).Value = DateDiff("y", fromDate, toDate)
x = x + 1
What am I doing wrong?
July 14th, 2014, 12:06 AM
Re: DateDiff assistance
Else maybe you should tell us what problem you are having.
Cells(x, 27).Value = DateDiff("yyyy", fromDate, toDate)
Always use [code][/code] tags when posting code.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!