+ Reply to Thread
Results 1 to 5 of 5

Text (number) , then csv save changes it back to number

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2017
    Location
    TwinCities
    MS-Off Ver
    2016
    Posts
    2

    Text (number) , then csv save changes it back to number

    I have a worksheet where I use a Vlookup and IF functions, In the if functions the results are numbers, but in a text form. IN other words the result is coming from a text cell with "123456789000" in it. When I copy the worksheet to a new worksheet everything gets transferred OK. I then save the new worksheet as a csv (ms-dos) file. When I open the CSV file instead of "123456789000' I get "1.2E+11. How do get it so save the full number, which is really a text.

    This is nit a column width issue. but some kind of conversion issue.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Text (number) , then csv save changes it back to number

    format the cells with 000000000000

    right mouse click

    first tab => then 12th option.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,362

    Re: Text (number) , then csv save changes it back to number

    I would say insufficient information to suggest a solution.

    One thing to note -- A csv file is all text with no formatting information. So the csv file cannot be converting a number stored as text to a number. However, Excel, when it opens a csv file, Excel's default is to convert any text in the csv file that it can interpret as a number to a number. I think a big part of debugging this sort of process is to be clear at exactly what step the "number stored as text" is being converted to a number. I expect it is the "file open" step in Excel where numbers are being converted back to numbers.

    It can be important to be clear about exactly what you are trying to do. Many times with this kind of question, the OP is creating the csv file from Excel, then re-opening the newly created csv file to "checK" to see if the csv file looks right. However, the intended application for the csv file is not Excel. In these cases, because Excel can misinterpret csv data (such as converting a number stored as text to a number), I find it better to "check" that the file was created correctly by using a text editor (such as notepad or wordpad) rather than Excel.

    If the intended target application is Excel, I find it preferable to use the "Import External Data -> from text" command rather than the File -> open command. When you use File->Open to open a csv file, Excel will use its default options to interpret the text file. Using the Import External data->from text command, Excel will bring up the text import wizard, which will allow you to better control the import settings for each column/field (including specifying that a given column should be treated strictly as text).

    Can you clarify exactly what your problem is and what your intended target for these csv files is?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    06-08-2017
    Location
    TwinCities
    MS-Off Ver
    2016
    Posts
    2

    Re: Text (number) , then csv save changes it back to number

    The CSV file needs to be provided to a financial institution to confirm some BI data. They are not able to use the data straight from excel so have requested a CSV file.


    The IF statement requests information is one of two cells. Both cells are formated as text. In the cells are numbers like '123456789000' and '987654321000' The worksheet is popoulated with other information some text but mostly numbers. A name range is created
    with the rows and columns I need. The Name range is copied to a another worksheet using:

    Sheets("Worksheet Register").Range("ReportCopy").Copy
    Sheets("ReportWorksheet").Range("A1").PasteSpecial Paste:=xlPasteValues

    All the values are correct and 123456789000' is still a text fill. I have put in letters with number to test and they come through.

    The worksheet is then saved as a CSV file. When I open the csv file (using Open Text) in excel I get 1.2E+11 instead of the full number. If I
    add a letter at the end such as "123456789000A" then I get "123456789000A."

    In the CSV file I want those numbers to look like the worksheet.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,362

    Re: Text (number) , then csv save changes it back to number

    In the CSV file I want those numbers to look like the worksheet.
    As I indicated, I would not use Excel to test this. I would open the csv file in a text editor, and verify that the file is correctly written from there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Result coming back as text not a number.....maybe?
    By bob0613282 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-29-2017, 11:48 AM
  2. Replies: 5
    Last Post: 01-19-2017, 12:44 AM
  3. [SOLVED] Bring back certain number of characters before a particular letter or number
    By loveridge01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2015, 05:49 AM
  4. Replies: 10
    Last Post: 10-30-2013, 07:29 PM
  5. [SOLVED] Counting Number of Times a Value is Repeated REPEATEDLY (Back to Back)
    By patrickfshield in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-06-2012, 04:45 AM
  6. A fourth way to convert numbers saved as text back to number?
    By trafficbroker in forum Excel General
    Replies: 2
    Last Post: 09-12-2011, 12:50 PM
  7. can you convert baht text back to a number?
    By maginator in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-02-2005, 11:30 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1