Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Keeping Leading Zeros

I have an ID number as ABCD-1234-123.
I use an Excel UI to add data to Access table.
The ID is division (alpha), department (four digits in the middle) and the
last three digits are sequence.
When I update this record, I actually want to add a new row to the table and
increment the sequence for each update.
So the initial record is ABCD-1234-001.
First update will be ABCD-1234-002.
Second update will be ABCD-1234-003 and so on.
Can some one please help with making sure that I keep the leading zeros.
Riight now, I cannot seem to do it.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Keeping Leading Zeros

Try using a text function to apply the specific formatting your interested in.
For example you can re-assemble the full ID string (if need be) using
CONCATENATE. Along the way you could use the TEXT function to ensure the
leading zeros exist (eg. if your last three numbers at some point appear as a
simple "2" in say cell M12, using =TEXT(M12,"00#") will ensure the retention
of those leading zeros..
For more hints on the use of text functions see "Excel Basics to Blackbelt"
( www.excel-blackbelt.com )


"omsoft" wrote:

I have an ID number as ABCD-1234-123.
I use an Excel UI to add data to Access table.
The ID is division (alpha), department (four digits in the middle) and the
last three digits are sequence.
When I update this record, I actually want to add a new row to the table and
increment the sequence for each update.
So the initial record is ABCD-1234-001.
First update will be ABCD-1234-002.
Second update will be ABCD-1234-003 and so on.
Can some one please help with making sure that I keep the leading zeros.
Riight now, I cannot seem to do it.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Keeping Leading Zeros


Thanks Elliot, but I was looking for a solution in VBA and not Excel formulae.

I found one, where I can get lengh of the cosecutive number and then force
add leading zeroes.

"Elliot" wrote:

Try using a text function to apply the specific formatting your interested in.
For example you can re-assemble the full ID string (if need be) using
CONCATENATE. Along the way you could use the TEXT function to ensure the
leading zeros exist (eg. if your last three numbers at some point appear as a
simple "2" in say cell M12, using =TEXT(M12,"00#") will ensure the retention
of those leading zeros..
For more hints on the use of text functions see "Excel Basics to Blackbelt"
( www.excel-blackbelt.com )


"omsoft" wrote:

I have an ID number as ABCD-1234-123.
I use an Excel UI to add data to Access table.
The ID is division (alpha), department (four digits in the middle) and the
last three digits are sequence.
When I update this record, I actually want to add a new row to the table and
increment the sequence for each update.
So the initial record is ABCD-1234-001.
First update will be ABCD-1234-002.
Second update will be ABCD-1234-003 and so on.
Can some one please help with making sure that I keep the leading zeros.
Riight now, I cannot seem to do it.

Thanks.

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
Keeping Leading Zeros; How Please ? Robert11[_2_] New Users to Excel 2 January 7th 12 06:15 PM
How to copy a number into a text cell, keeping leading zeros? Basher Bates Charts and Charting in Excel 2 February 23rd 08 03:26 PM
Keeping leading zeros in imported data (one digit month as 05) exito816 Excel Discussion (Misc queries) 2 September 28th 07 10:35 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
Keeping leading zeros in field Gary Brown[_7_] Excel Programming 0 September 2nd 04 06:28 PM


All times are GMT +1. The time now is 06:58 PM.

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"