I have columns of cells that list date and time. Each cell looks like this:
3/17/2006 3:30:00 PM
I need VBA to loop through and remove the time and leave just the date. When finished it will look like this:
3/17/2006
A simple left trim doesn't work because of varied lengths of month, date, and time. The For Next loop isn't the problem, but I can't figure out what to do to trim the time.
I have tried:
This doesn't work. I don't think "Find" is a valid VBA term.
Any suggestions will be appreciated.
Bubba
3/17/2006 3:30:00 PM
I need VBA to loop through and remove the time and leave just the date. When finished it will look like this:
3/17/2006
A simple left trim doesn't work because of varied lengths of month, date, and time. The For Next loop isn't the problem, but I can't figure out what to do to trim the time.
I have tried:
Code:
vCdate = Cells(sRow, 5).Value
vTrimDate = Left(vCdate, Find(" ", vCdate) - 1)
Cells(sRow, 5).Value = vTrimDate
This doesn't work. I don't think "Find" is a valid VBA term.
Any suggestions will be appreciated.
Bubba