Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Format dates and not Zeros

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Format dates and not Zeros

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Format dates and not Zeros

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Format dates and not Zeros

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Format dates and not Zeros

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing zeros with blanks but leaving dates alone Evil with a K[_2_] Excel Worksheet Functions 3 May 15th 09 06:48 PM
Sorting Dates when there are zeros in the month and/or day ktbull Excel Discussion (Misc queries) 2 January 15th 09 06:26 PM
Format zeros octet Excel Discussion (Misc queries) 4 April 4th 08 12:04 AM
leading zeros fall off in csv format. susanmarie Excel Discussion (Misc queries) 4 January 9th 08 07:15 PM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM


All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"