+ Reply to Thread
Results 1 to 8 of 8

VBA Spell out currency - need help finishing it

  1. #1
    Registered User
    Join Date
    01-08-2016
    Location
    Timisoara, Romania
    MS-Off Ver
    2013
    Posts
    12

    VBA Spell out currency - need help finishing it

    I've been working on a way to spell out currency in Romanian for a while now but still haven't made it work entirely.

    The problem with the Romanian language is that currency has different genders. For example, hundred or thousand is female, so the words for "one" and "two" are different than "one" and "two" for digits, which are male.


    The code below is mostly working:

    Please Login or Register  to view this content.
    However, there are two major problems with it:

    First, I need it to work up to single thousands, max. 9999.99, but at the moment it only works up to 999.99.
    This portion of the code (which I copied from the hundreds and modified) does nothing:
    Please Login or Register  to view this content.

    Second, the currency has the equivalent to cents which is extracted using this formula:
    Please Login or Register  to view this content.
    The problem with this is that even though it should work, it keeps skipping every two digits, so instead of going .01, .02, .03, .04, it only shows .00, .02, .02, .04 etc.

    edit: I figured out the second problem using the TRUNC function in the main worksheet. Apparently Int doesn't actually truncate, it does a weird roundup.


    Any help would be appreciated.
    Last edited by vitesse; 01-14-2016 at 03:06 PM.

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: VBA Spell out currency - need help finishing it

    Hello my friend

    Try changing this point:

    Please Login or Register  to view this content.
    To:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-08-2016
    Location
    Timisoara, Romania
    MS-Off Ver
    2013
    Posts
    12

    Re: VBA Spell out currency - need help finishing it

    I changed both last instances of that code to what you suggested and it didn't work. It's just 0 all the time now.

    Thanks for the reply though.

  4. #4
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: VBA Spell out currency - need help finishing it

    Did you change all "Int" for CDbl?

  5. #5
    Registered User
    Join Date
    01-08-2016
    Location
    Timisoara, Romania
    MS-Off Ver
    2013
    Posts
    12

    Re: VBA Spell out currency - need help finishing it

    Yes.

    I changed all "Ind" for "CDbl" in the entire code and while the main code works as before, the "BANI" part (cents equivalent) at the end still doesn't work.

  6. #6
    Registered User
    Join Date
    01-08-2016
    Location
    Timisoara, Romania
    MS-Off Ver
    2013
    Posts
    12

    Re: VBA Spell out currency - need help finishing it

    After multiple tries, I gave up on trying to make the end part work properly. It seems that the Int function doesn't truncate properly, but rounds the number somehow.

    Using
    Please Login or Register  to view this content.
    in the worksheet works fine.

    Now all I need is to make the thousands part work in the main code.

  7. #7
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: VBA Spell out currency - need help finishing it

    Oh... well... sorry didn't help for real
    Glad you solved your problem

  8. #8
    Registered User
    Join Date
    01-08-2016
    Location
    Timisoara, Romania
    MS-Off Ver
    2013
    Posts
    12

    Re: VBA Spell out currency - need help finishing it

    Don't worry about it.
    Your suggestion made me look closer into the Int function, which helped me realize that it's flawed.

    So even though it wasn't quite what you had in mind, you still helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Changing Spell Check language of Vba Spell Checker
    By jhelliar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2021, 03:51 AM
  2. Replies: 1
    Last Post: 10-20-2014, 11:01 AM
  3. spell number function with currency
    By 4joey1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-01-2014, 07:38 PM
  4. Replies: 6
    Last Post: 05-08-2014, 08:41 AM
  5. Need Help Finishing My Sheet
    By Adam Schaefer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-18-2013, 10:02 PM
  6. Error in saving a single Worksheet with spell currency
    By jwala in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2010, 12:29 AM
  7. Spell number in indian currency
    By vsts2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2010, 04:03 AM

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