User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Creating a macro in excel Page [1]  
cornbread
All American
2809 Posts
user info
edit post

I know there are many google pages on this, I just don't have time to waste learning VB. Cut me the slack I've never used it before.

Here's what I'm looking to do.

read a set of digits
convert the digits to text and include any leading zeros to make 12 digits if the first set isn't 12 digits.

I realize I can change the number to 12 digits and have it DISPLAY 12 digits but when that number is read it will chop off the leading zeros. I'm trying to create some barcodes that must be 12 digits

ie.
393936300 to 000393936300
some may be
39393630010 to 03939363001
or
3939363 to 000003939363

4/21/2006 3:58:23 PM

EMCE
balls deep
89807 Posts
user info
edit post

I would help you out man, really I would

but I'm about to take a nap

sorry

if you still have no help by about 7:00pm, I'll help

4/21/2006 5:03:32 PM

LimpyNuts
All American
16859 Posts
user info
edit post

Put a number in cell A1. In B1, Put "=LEFT("000000000000",12-LEN(A1)) & A1"

No VBA necessary.

4/21/2006 5:48:44 PM

cornbread
All American
2809 Posts
user info
edit post

Thanks LimpyNuts worked like a charm

4/21/2006 9:19:37 PM

State409c
Suspended
19558 Posts
user info
edit post

I think you can just format the cell to have 0's for leading characters, its even easier than limpnuts showed you.

4/22/2006 12:12:14 AM

cornbread
All American
2809 Posts
user info
edit post

no, I need it to do more than just show the zeros. I did that before but when you click on the cell or link to it it drops the leading zeros. So I need it to translate it to text. That function worked great.

4/22/2006 9:15:31 AM

HaLo
All American
14276 Posts
user info
edit post

i think you could have formatted the cell with the leading zeroes, then copy and paste special the cells and only checking the "values" box on the paste special window

4/22/2006 10:13:49 AM

 Message Boards » Tech Talk » Creating a macro in excel Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.