+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Forum Contributor
    Join Date
    11-14-2005
    Location
    Somewhere....out there.....
    Posts
    126

    How to keep data as text from external file

    We asre using MS Excel 2003 and the SAS Add-in for Excel. When we attempt to pull data created by SAS into Excel, columns that are supposed to be text are coming in as numeric. I know there's something in Excel that if it sees something like "000123456" in a column, it'll think that is numeric, although it should be text.

    Is there something I can do in Excel to keep a character column as character data, even if the data looks like a number?

    Thnaks in advance!

  2. #2
    Forum Contributor
    Join Date
    11-14-2005
    Location
    Somewhere....out there.....
    Posts
    126
    Anybody?? Please ?

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,497
    Hello Greaseman,

    Select the entire column you want to display only text, and Right Click. Select Format Cells... from the pop up menu. Click the Number tab. Under the headingCategory, click Text then clik OK.

    Sincerely,
    Leith Ross

  4. #4
    Forum Contributor
    Join Date
    11-14-2005
    Location
    Somewhere....out there.....
    Posts
    126
    Leith,

    Thanks for replying..... however, when the text data comes over and Excel thinks it is numeric data, leading zeros are suppressed, which we want to keep. So, even highlighting the column and formatting manually as text won't help us. The leading zeros are already gone at this point. We want to keep text records such as "000123456" in Excel as "000123456".

    Is there some setting in Excel 2003 that will tell Excel to keep text as text in these cases?

    Thanks again!

  5. #5
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140
    If they should all be the same length, say 9 digits, and the numbers coming across are all 6 digits, or if you need to add the same # of 0s to every number regardless of length, you can have a helper column that is =000&A1 and drag down. If the number of digits that is coming across varies, but the end numbers should all have the same digits, =Rept(0,9-Len(A1))&A1. Then you can copy and paste values.

  6. #6
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163
    If you "preformat" the column that the numbers are going into as Text, this may work.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Forum Contributor
    Join Date
    11-14-2005
    Location
    Somewhere....out there.....
    Posts
    126
    Thank you all for your replies and suggestions.... I'll keep plugging away untile I get it worked out, and will most likely try to incorporate your suggestions into a macro to apply against the workbook sheet.

    Thanks again! I appreciate it!

Thread Information

Users Browsing this Thread

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

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.2.0