Format Column to display leading zeros.

G

Glenn Buchanan

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
 
G

GTVT06

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"
 
G

Glenn Buchanan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top