+ Reply to Thread
Results 1 to 6 of 6

Parsing String into Currency

  1. #1
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Parsing String into Currency

    I would like to parse a string into Currency. For example when the user enters 24885 instead of 248.85 the function returns 248.85. So far I've gotten this but I can't figure out how to read the string leaving out the last two digits (it could vary in length).

    Please Login or Register  to view this content.
    The x in dollars is just a place holder b/c I have no idea what to put there or if the line should be different.
    Last edited by lloydgodin; 12-05-2012 at 05:17 PM. Reason: Clarification

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Parsing String into Currency

    Maybe dollars = CCur(left(iCur,X))

  3. #3
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: Parsing String into Currency

    but what is X?

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Parsing String into Currency

    Try this

    dollars = CCUR(left(iCur,len(icur)-3))

  5. #5
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: Parsing String into Currency

    I edited the post to clarify that it's a place holder because I have no idea what to put there. Or if something should even go there...
    oh wait!!!

    x could be the length of the string - 2?!

  6. #6
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: Parsing String into Currency

    Please Login or Register  to view this content.
    Got it. Thanks!!

  7. #7
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: Parsing String into Currency

    FINALIZED CODE:

    Please Login or Register  to view this content.
    USES LINE BELOW TO USE THE FUNCTION:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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