+ Reply to Thread
Results 1 to 6 of 6

Preventing Scientific Notation From Autoconverting

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45

    Preventing Scientific Notation From Autoconverting

    Hello,

    In many of my macros I deal with inputting data into Excel that may have the form "27E10" or other such string values.

    Unfortunately, Excel seems to automatically convert this (first to 27x10^10, and then, if I try to uncovert it, it is listed as 270000000000) data. I do not know how to make it stop doing this.

    It often is a problem when I have data delimited in that form because when I put the data into columns, it automatically is no longer the "27E10" value but instead the above numeric values.

    Any way around this would be greatly appreciated!

    Thanks,
    Googlebot

  2. #2
    Forum Contributor
    Join Date
    10-16-2008
    Location
    Iowa
    Posts
    121
    In Excel, the CStr function converts a value to a string.

    The syntax for the CStr function is:

    CStr( expression )

    e.g. CStr("27E10")

    not sure about needing the quotes

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Preventing Scientific Notation From Autoconverting

    You could change the NumberFormat of the cell first
    Please Login or Register  to view this content.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  4. #4
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    I apologize for the delay in responding.

    Those work fine when I am making a specific instance, but when I use text to columns with data containing these values (say 1E3%testing%2E5 as a single 'row' of data for example) even if the cell the value is going into is formatted like done above, it converts it.

    I cannot seem to find a workaround (other than perhaps doing my own manual text to columns code...).

    Thanks again in advance!

  5. #5
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    I have figured out a way to do this, but it has brought upon another question which I will ask in a new thread.

  6. #6
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    Ok, it can be prevented, but still causes problems as vlookup doesn't work with data formatted as "text."

    Any solutions?

+ Reply to Thread

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.6.0 RC 1