Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need some code to:
I have a column (F) that contains dates and zeros. How can I change the format to date (YYYYMMDD) and leave the zeros as zeros and not get the 19000100 date? 0 6/7/2004 7/19/2004 0 0 0 0 0 1/31/2005 3/14/2005 9/13/2004 10/18/2004 1/31/2005 7/12/2004 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
not possible without manually changing the format for these zero cells -- Regards Frank Kabel Frankfurt, Germany schrieb im Newsbeitrag ... I need some code to: I have a column (F) that contains dates and zeros. How can I change the format to date (YYYYMMDD) and leave the zeros as zeros and not get the 19000100 date? 0 6/7/2004 7/19/2004 0 0 0 0 0 1/31/2005 3/14/2005 9/13/2004 10/18/2004 1/31/2005 7/12/2004 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 27 May 2004 11:50:36 -0700,
wrote: I need some code to: I have a column (F) that contains dates and zeros. How can I change the format to date (YYYYMMDD) and leave the zeros as zeros and not get the 19000100 date? 0 6/7/2004 7/19/2004 0 0 0 0 0 1/31/2005 3/14/2005 9/13/2004 10/18/2004 1/31/2005 7/12/2004 Format/Cells/Number Category: Custom Type: [=0]0;yyyymmdd --ron |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you use something like:
Dim N As Integer, Limit As Integer Limit=(whatever) For N=1 to Limit If Range("A" & N).Value < 0 _ Then Format(Range("A" & N).Value,"YYYMMDD") End For -----Original Message----- I need some code to: I have a column (F) that contains dates and zeros. How can I change the format to date (YYYYMMDD) and leave the zeros as zeros and not get the 19000100 date? 0 6/7/2004 7/19/2004 0 0 0 0 0 1/31/2005 3/14/2005 9/13/2004 10/18/2004 1/31/2005 7/12/2004 . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 27 May 2004 15:36:13 -0400, Ron Rosenfeld
wrote: On Thu, 27 May 2004 11:50:36 -0700, wrote: I need some code to: I have a column (F) that contains dates and zeros. How can I change the format to date (YYYYMMDD) and leave the zeros as zeros and not get the 19000100 date? 0 6/7/2004 7/19/2004 0 0 0 0 0 1/31/2005 3/14/2005 9/13/2004 10/18/2004 1/31/2005 7/12/2004 Format/Cells/Number Category: Custom Type: [=0]0;yyyymmdd --ron I missed that you wanted VBA code to do this: Range("F:F").NumberFormat = "[=0]0;yyyymmdd" --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
replacing zeros with blanks but leaving dates alone | Excel Worksheet Functions | |||
Sorting Dates when there are zeros in the month and/or day | Excel Discussion (Misc queries) | |||
Format zeros | Excel Discussion (Misc queries) | |||
leading zeros fall off in csv format. | Excel Discussion (Misc queries) | |||
save text field w/ leading zeros in .csv format & not lose zeros? | Excel Discussion (Misc queries) |