Force leading zeros

  • Thread starter Superior North Shore
  • Start date
S

Superior North Shore

We have an excel spreadsheet which we use to import data into a database. We
have one column (PID) which needs to be validated before loading the
remaining data for the row into the database. The user copies the data from
another source and pastes it into the spreadsheet. The PID column needs to be
12 digits and have leading zeros if the length is less than 12 digits. We can
set the cell format to show the leading zero but when the spreadsheet is
imported, the leading zeros are not present in the raw data. The only option
we have come up with so far it to create a second column which has a formula
=Text(cell containing the value, "000000000000"). Our goal is not to have to
create this new column. We don't want to force the twelve digits during the
import because our requirements are to validate the PID, not to format it
properly. Any suggestions will be welcomed.

Thanks!
 

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