Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Oct 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro to convert figures in USD to a different currency

    Hi everyone,

    I have a Word document that contains a huge amount of figures in US dollars that I would like to convert to a different currency. I am trying to figure out if it would be possible to write a macro that finds all these numbers and multiplies them by a user-defined constant? I'm somewhat lacking in the VB programming department but does anyone here know if this is even possible? I'm thinking the biggest challenge is to correctly identify each figure, i.e. "123,456.78" should not be identified as three separate numbers etc. Does anyone have any ideas?

    Any help would be greatly appreciated!

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,899
    Thanks
    0
    Thanked 188 Times in 172 Posts
    Doing a currency conversion is a trivial exercise. Amounts containing ',' for a thousands separator and '.' for a decimal separator are understood in VBA as a single number. All you really need to know is how to identify where the amounts are (you probably wouldn't want to convert dates & times, for example) and what the conversion rates are. Indeed, if the data are all in a table and you want to retain the original, the conversion rate and the result, you don't even need VBA - it can all be done with field coding.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •