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

I'm converting an access report to excel and when I do, it is dropping the
leading zeros in column D and E. I need to write a macro to put the zeros
back in but my problem is that not every cell needs the zero added. Every
cell should be 6 alpha-numeric characters. If the data in the cell is only 4
characters, I need to add 2 leading zeros or if there is only 2 characters, I
would need to add 4 leading zeros. My spreadsheet very lengthy so I need a
macro to add the zeros, any help you can give me is appreciated, thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Adding leading zeros

Why not just format the column as 000000?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"SITCFanTN" wrote in message
...
I'm converting an access report to excel and when I do, it is dropping the
leading zeros in column D and E. I need to write a macro to put the zeros
back in but my problem is that not every cell needs the zero added. Every
cell should be 6 alpha-numeric characters. If the data in the cell is
only 4
characters, I need to add 2 leading zeros or if there is only 2
characters, I
would need to add 4 leading zeros. My spreadsheet very lengthy so I need
a
macro to add the zeros, any help you can give me is appreciated, thank
you.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Adding leading zeros

Format your cells using a customer format of
000000

That should do what you want.

HTH,
Paul

"SITCFanTN" wrote in message
...
I'm converting an access report to excel and when I do, it is dropping the
leading zeros in column D and E. I need to write a macro to put the zeros
back in but my problem is that not every cell needs the zero added. Every
cell should be 6 alpha-numeric characters. If the data in the cell is
only 4
characters, I need to add 2 leading zeros or if there is only 2
characters, I
would need to add 4 leading zeros. My spreadsheet very lengthy so I need
a
macro to add the zeros, any help you can give me is appreciated, thank
you.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Adding leading zeros

What the heck is "customer" format? That was supposed to be "custom"
format.

"PCLIVE" wrote in message
...
Format your cells using a customer format of
000000

That should do what you want.

HTH,
Paul

"SITCFanTN" wrote in message
...
I'm converting an access report to excel and when I do, it is dropping
the
leading zeros in column D and E. I need to write a macro to put the
zeros
back in but my problem is that not every cell needs the zero added.
Every
cell should be 6 alpha-numeric characters. If the data in the cell is
only 4
characters, I need to add 2 leading zeros or if there is only 2
characters, I
would need to add 4 leading zeros. My spreadsheet very lengthy so I need
a
macro to add the zeros, any help you can give me is appreciated, thank
you.





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
CONVERT NOs TO EAN 8 BY ADDING LEADING ZEROS pdb Excel Discussion (Misc queries) 7 February 13th 09 07:46 PM
Leading zeros LeePotts Excel Discussion (Misc queries) 2 August 17th 05 02:46 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
Adding Leading Zeros to Text Jenn Excel Discussion (Misc queries) 4 January 12th 05 06:51 PM
Adding leading zeros to a calculated value John Johndon Excel Programming 2 July 12th 03 06:25 PM


All times are GMT +1. The time now is 11:31 PM.

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"