PC Review


Reply
Thread Tools Rate Thread

Adding leading zeros

 
 
=?Utf-8?B?U0lUQ0ZhblRO?=
Guest
Posts: n/a
 
      10th Jul 2007
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      10th Jul 2007
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" <(E-Mail Removed)> wrote in message
news:9D4EDD5B-10DB-45B0-89E1-(E-Mail Removed)...
> 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 With Quote
 
PCLIVE
Guest
Posts: n/a
 
      10th Jul 2007
Format your cells using a customer format of
000000

That should do what you want.

HTH,
Paul

"SITCFanTN" <(E-Mail Removed)> wrote in message
news:9D4EDD5B-10DB-45B0-89E1-(E-Mail Removed)...
> 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 With Quote
 
PCLIVE
Guest
Posts: n/a
 
      10th Jul 2007
What the heck is "customer" format? That was supposed to be "custom"
format.

"PCLIVE" <pclive(RemoveThis)@cox.net> wrote in message
news:(E-Mail Removed)...
> Format your cells using a customer format of
> 000000
>
> That should do what you want.
>
> HTH,
> Paul
>
> "SITCFanTN" <(E-Mail Removed)> wrote in message
> news:9D4EDD5B-10DB-45B0-89E1-(E-Mail Removed)...
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CONVERT NOs TO EAN 8 BY ADDING LEADING ZEROS pdb Microsoft Excel Misc 5 13th Feb 2009 06:58 PM
adding leading zeros =?Utf-8?B?Q2hyaXM=?= Microsoft Access Queries 3 19th Apr 2005 06:23 PM
Adding back Leading Zeros =?Utf-8?B?UGV0ZSBBdWd1c3Q=?= Microsoft Access 2 26th Jan 2005 09:20 PM
Adding Leading zeros Nat Microsoft Access 2 16th Dec 2003 09:17 PM
Adding leading zeros to a calculated value John Johndon Microsoft Excel Programming 2 12th Jul 2003 06:25 PM


Features
 

Advertising
 

Newsgroups
 


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