Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You might be looking for this:
=Text(Now(), "mm/dd/yyyy") Which give the date as a string. "cate" wrote in message ... I am reading a cell that was populated with NOW(). It contains a time part I do not want. There has got to be a trunc() function somewhere, but I can't find it. Was going to try WorksheetFunction.Date, but it's not there? (I thought that anything available for use on the sheet would show up here) So, do I build a string and use DateTime.DateValue, or DateSerial, to get just the date part and eliminate the time component? It works ok, but it just doesn't seem like it's the way to do it. Thank you. Here is one example of removing time. Is this the proper way to do it? (will be 'vba'd) http://www.techonthenet.com/excel/qu...emove_time.php Excel: Convert date/time value to a date value (remove time portion) in Excel 2003/XP/2000/97 Answer: In order for Excel to recognize the values as dates, you will need to modify your formula as follows: =DATEVALUE(MONTH(A1) & "/" & DAY(A1) & "/" & YEAR(A1)) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
msWinSck.ocx: Run-Time Error 429 ActiveX Component can't create ob | Excel Programming | |||
Date Picker component | Excel Programming | |||
Run time '429' : ActveX component can't create object | Excel Programming | |||
How to truncate date | Excel Worksheet Functions | |||
Truncate Cell text all the time | Excel Programming |