Add a zero preceding a value in a cell...

A

Andre vWG

Hi there,

I have managed to import a csv file in excel with vbscript (thanks to
Günter Born)

In that csv file the second column exists of number of a shop (ie 001
002 013 207). As you see the first character can be a zero.

When I look at the Excel-sheet the second column looks like 1 2 13 207
(so no preceding zeros)

Does anyone know how to change an entire column in Excel in a three
digit text (adding "00" to 1 "0" to 13 and nothing to 207)

In Excel (XP-version) you can use =right("000" & b2;3)!

Tia,

André
 
T

Tushar Mehta

Consider a change to the process of importing the file. Specify the 2nd
column as a text field with a width of 15. That way XL will treat it
exactly as it appears in the csv file.

--
Regards,

Tushar Mehta
MS MVP Excel 2000-2003
www.tushar-mehta.com
Excel, PowerPoint, and VBA tutorials and add-ins
Custom Productivity Solutions leveraging MS Office
 

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