+ Reply to Thread
Results 1 to 3 of 3

Prevent Scientific / Exponential Notation (in CStr) ?

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    New England, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Prevent Scientific / Exponential Notation (in CStr) ?

    Greetings -

    I need to create a text .psv (Pipe Separated Value) file from Excel percentage data
    with ~15 significant digits (e.g. - 87.1083154822352%, 0.0720306042793482%).

    No matter what formatting I try, using VBA to create a string from this data
    (using either Str or CStr) generates undesired scientific notation
    (e.g. - 1.12345678901234E-04) for several of the data points.

    So, I wrote a bit of code to parse that notation:

    Please Login or Register  to view this content.
    Feedback welcome, particularly as regards things to watch out for, or a simpler programmatic solution
    (i.e. - turning off the friendly notation).

    Thanks,

    - Richard
    Last edited by expatCanuck; 04-02-2012 at 03:05 PM.

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Prevent Scientific / Exponential Notation (in CStr) ?

    could you attach any workbook with dummy data to export ?
    And present how finally your text file should looks like ?
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Lightbulb Re: Prevent Scientific / Exponential Notation (in CStr) ?

    I don't know if you will ever see that reply but here is a way to do this without looping
    Please Login or Register  to view this content.
    in attached file you will find working example
    Attached Files Attached Files

+ 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