Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a macro that can remove the time from the date. I tried
formating the cell and it remove time from the cell. However if you select the cell the time remains. 3/20/2009 8:10:40 PM |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You just need the mod function to get the fractional part of the time. Use
this =Mod(A1,1) Format the results in any time format you choose. "Little Penny" wrote: Is there a macro that can remove the time from the date. I tried formating the cell and it remove time from the cell. However if you select the cell the time remains. 3/20/2009 8:10:40 PM |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean you removed the time portion and it still displayed 12:00:00 AM,
that is correct...the date/time at 0 hours, 0 minutes, 0 seconds into the day is exactly midnight. DateValue will strip off the time or, to put it another way, convert the time to exactly midnight. Dim dt As Date dt = Now() MsgBox DateValue(dt) Use a function to get the date-only portion of a date(time). Use formatting to display the results without the time, e.g. "m/d/yy". -- Tim Zych http://www.higherdata.com Workbook Compare - Excel data comparison utility Free and Pro versions "Little Penny" wrote in message ... Is there a macro that can remove the time from the date. I tried formating the cell and it remove time from the cell. However if you select the cell the time remains. 3/20/2009 8:10:40 PM |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The below code will extract the date part from Column A and write to Column
B. Please try... If this post helps click Yes -------------- Jacob Skaria Dim intRow intRow = 1 Do While Range("A" & intRow) < "" Range("B" & intRow) = Format(Range("A" & intRow), "dd-mm-yyyy") intRow = intRow + 1 Loop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
remove the date, leave the time | Excel Discussion (Misc queries) | |||
Remove Time from Date | Excel Discussion (Misc queries) | |||
Remove Time Element of a Date | Excel Worksheet Functions | |||
Remove time from a date and time field? Format removes the displa. | Excel Worksheet Functions | |||
Remove time from date time | Excel Programming |