Results 1 to 2 of 2
2014-10-15, 02:03 #1
- Join Date
- Oct 2014
- Thanked 0 Times in 0 Posts
Macro to convert figures in USD to a different currency
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!
2014-10-16, 01:48 #2
- Join Date
- May 2002
- Canberra, Australian Capital Territory, Australia
- Thanked 439 Times in 362 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,
[MS MVP - Word]