• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Excel - Set the column data type

New Here ,
Jan 31, 2007 Jan 31, 2007

Copy link to clipboard

Copied

I am trying to write a long number (ex: credit card number) to a spreadsheet column and excel is giving me the E+ bla bla error as it is trying to write it as number. My only chance to display it correctly, is to output it as string and the only way to achieve this is by pre-pending a 'string' character (ex: a space or   or a quote or whatever.)
The problem is that the client doeasnt want any foreign character in the cell for he wouldnt have to search and replace thousanends of record. (They find it awkward! dont understand why, since this si done in one go. Anyway..)

Is there any way I can instruct the excel that the long number is to be written as string?
TOPICS
Advanced techniques

Views

346

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 31, 2007 Jan 31, 2007

Copy link to clipboard

Copied

Yes.
What format are you writing? Native Excel, XML, HTML-Table, ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2007 Jan 31, 2007

Copy link to clipboard

Copied

hi Stefan,
i am writing html table.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 12, 2007 Feb 12, 2007

Copy link to clipboard

Copied

It depends on the version of Excel. Some of the latest versions you can enclose the data in double quotes and precede the first digit with a space. Older versions of Excel I have found no way to solve this issue -- they always look at the data as a number.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 12, 2007 Feb 12, 2007

Copy link to clipboard

Copied

LATEST
You can use cascading styleshees (CSS) to force newer versions of excel to treat the data as different types (text, numeric, etc). Create an example of the file you want to write, save as HTML and then take a look at the stylesheet information on the resulting file. I don't remember off the top of my head what the exact CSS property is to force Excel to treat it as text, but you should be able to figure it out by process of elimination.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation