Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format Column to display leading zeros.

Using an external program with a language very similar to VB I have a script
that uses CreateObject to create a new workbook and fill with data. All well
and good. I have one column that is filled mostly with numbers where I need
to see any leading zeros.
How would I format this column before filling it? Changing the format after
the data is entered results in missing leading zeros.
With xl
..ActiveSheet.Columns("F:F").NumberFormat = ?

Regards,
Glenn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Format Column to display leading zeros.

On Mar 22, 1:15*pm, Glenn Buchanan <Glenn
wrote:
Using an external program with a language very similar to VB I have a script
that uses CreateObject to create a new workbook and fill with data. All well
and good. I have one column that is filled mostly with numbers where I need
to see any leading zeros.
How would I format this column before filling it? Changing the format after
the data is entered results in missing leading zeros.
With xl
.ActiveSheet.Columns("F:F").NumberFormat = ?

Regards,
Glenn

The ZipCode format alows leading 0's Example:
With xl
.ActiveSheet.Columns("F:F").NumberFormat = "0000"
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Format Column to display leading zeros.

Look he

http://support.microsoft.com/kb/81518

"Glenn Buchanan" wrote:

Using an external program with a language very similar to VB I have a script
that uses CreateObject to create a new workbook and fill with data. All well
and good. I have one column that is filled mostly with numbers where I need
to see any leading zeros.
How would I format this column before filling it? Changing the format after
the data is entered results in missing leading zeros.
With xl
.ActiveSheet.Columns("F:F").NumberFormat = ?

Regards,
Glenn

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format Column to display leading zeros.

Thanks to all who replied to my post.
After experimenting I found Peter's suggestion worked the best for my
variable length data.
Thanks again.
Glenn.

"Peter T" wrote:

as text -

rng.NumberFormat = "@"

Regards,
Peter T

"Glenn Buchanan" <Glenn wrote in message
...
Using an external program with a language very similar to VB I have a

script
that uses CreateObject to create a new workbook and fill with data. All

well
and good. I have one column that is filled mostly with numbers where I

need
to see any leading zeros.
How would I format this column before filling it? Changing the format

after
the data is entered results in missing leading zeros.
With xl
.ActiveSheet.Columns("F:F").NumberFormat = ?

Regards,
Glenn




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
How do I display leading zeros? 5551scj Setting up and Configuration of Excel 1 September 25th 09 05:45 PM
Display leading zeros in numeric value without converting to text Gmonny Excel Discussion (Misc queries) 4 October 5th 06 09:05 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
Display Binary Leading Zeros tocuin hollisgroup com> Excel Discussion (Misc queries) 2 February 24th 05 01:12 AM
How do I display leading zeros so I can export a fixed in Excel? World Referee and accountant Excel Discussion (Misc queries) 2 January 3rd 05 04:18 PM


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

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

About Us

"It's about Microsoft Excel"