Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello, I receive data from our geologist from a program that drops the
leading 0 from the API #'s for different wells. I need/have to restore this 0 in order to do imports into the software I use. So I have a #: 11256094 that should read: 011256094 I have tried using the concatonate function sucessfully in excel (setting up a '0 in one cell and the 11256094 in another cell), but when I save it as a csv file, it drops the lead zero. I've reformatted my cells to text, but this is still not helping solve this problem. Any help will be appreciated. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Excel will save the leading zeros in a CSV file for text data, but it will
have a problem inputting them back into Excel. From the sounds of your problem another application (not Excel) is creating the fields without the leading zeros. If they are all of a fixed length and below 16 digits you could change the format, cells, custom format to something like: 000000000 Try formatting as text when you import the file Data, Import file, external data which should bring up the imput text wizard. Changing format between number and text is not effective until data is reentered. If you want them in Excel as text you could modify the macro at http://www.mvps.org/dmcritchie/excel/join.htm#fixUSzip5 to have nine digits instead of 5 digits and remove redundant coding. For a worksheet solution as text via a helper column. =RIGHT("000000000" & TRIM(A1), 9) --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Kathy" <Kathy @discussions.microsoft.com wrote in message ... Hello, I receive data from our geologist from a program that drops the leading 0 from the API #'s for different wells. I need/have to restore this 0 in order to do imports into the software I use. So I have a #: 11256094 that should read: 011256094 I have tried using the concatonate function sucessfully in excel (setting up a '0 in one cell and the 11256094 in another cell), but when I save it as a csv file, it drops the lead zero. I've reformatted my cells to text, but this is still not helping solve this problem. Any help will be appreciated. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
David,
Thank you for your suggestions - I will try them out next time... in the meantime, I found a helpful path from Excel where I used 2 cells and merged them with this command: =A2&""&B2&" then I pasted it to another column with the values only - when I saved this in Excel and then in a csv file - it imported just fine into my software! I'm not sure if my approach is harder or not? Thank you again, "David McRitchie" wrote: Excel will save the leading zeros in a CSV file for text data, but it will have a problem inputting them back into Excel. From the sounds of your problem another application (not Excel) is creating the fields without the leading zeros. If they are all of a fixed length and below 16 digits you could change the format, cells, custom format to something like: 000000000 Try formatting as text when you import the file Data, Import file, external data which should bring up the imput text wizard. Changing format between number and text is not effective until data is reentered. If you want them in Excel as text you could modify the macro at http://www.mvps.org/dmcritchie/excel/join.htm#fixUSzip5 to have nine digits instead of 5 digits and remove redundant coding. For a worksheet solution as text via a helper column. =RIGHT("000000000" & TRIM(A1), 9) --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Kathy" <Kathy @discussions.microsoft.com wrote in message ... Hello, I receive data from our geologist from a program that drops the leading 0 from the API #'s for different wells. I need/have to restore this 0 in order to do imports into the software I use. So I have a #: 11256094 that should read: 011256094 I have tried using the concatonate function sucessfully in excel (setting up a '0 in one cell and the 11256094 in another cell), but when I save it as a csv file, it drops the lead zero. I've reformatted my cells to text, but this is still not helping solve this problem. Any help will be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro save a workbook whilst increasing file no | Excel Worksheet Functions | |||
How to save worksheet in .cvs format? | Excel Discussion (Misc queries) | |||
cannot edit and save | New Users to Excel | |||
cannot edit and save | Excel Discussion (Misc queries) | |||
How do I format data cells in Excel to keep leading zeroes? | Setting up and Configuration of Excel |