Conditioally insert characters to beginning of cell

dcliffo

Board Regular
Joined
Jun 18, 2003
Messages
148
I have a column of Supplier IDs. Maximum number of characters is 9. If the supplier ID is not 9 characters long, it should have 0's placed in the front so that there are 9 characters. For example, Supplier ID is 487695. It should look like 000487695. I can get Excel to format the cells correctly by using the custom format. However, when I import into Access, it trims the 0's away even though the field is identified as text because the custom format does not actually change the "value" of the cell. It merely formats the cells.

How can I get this column to correctly import into Access from Excel? :cry:
 
The above will give you trailing @'s, i.e. 12345 >> 12345@@@@

This will give you leading @'s, i.e. 12345 > > @@@@12345

=RIGHT("@@@@@@@@@"&A1,9)
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,548
Messages
6,125,468
Members
449,230
Latest member
ASBeard

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top