Denis
Do you mean formatted in another currency or actually recalculated using an exchange rate?
If the latter, would I be right in assuming the exchange rate would be subject to change?
Regards
Robb
Yeah, i would like the area which contains the figures (say £) to be replaced by figures in another currency - depending on the macro selected. The exchange rate would definitely need to be modifiable.
Thank you.
Denis
Denis
Here are 2 lots of code, written for CommandButtons but you could
use it any way you like. Given the number of different currency symbols, I have not
formatted to show them, just the amounts.
Also, since people quote rates in different ways, I have indicated which one multiplies by the rate and
which one divides. Rates are input by way of Input Boxes.
All the figures in Sheet1 will be converted - of course you may amend the sheet names.
Private Sub CommandButton1_Click()
'Multiply by the exchange rate
getrate = InputBox("Enter the current rate")
If getrate = "" Then Exit Sub
userate = CDec(Format(getrate, "0.0000"))
For Each c In Worksheets("Sheet1").UsedRange.Cells
If Not c = "" Then c.Value = Format(c * userate, "0.00")
Next c
End Sub
Private Sub CommandButton2_Click()
'Divide by the exchange rate
getrate = InputBox("Enter the current rate")
If getrate = "" Then Exit Sub
userate = CDec(Format(getrate, "0.0000"))
For Each c In Worksheets("Sheet1").UsedRange.Cells
If Not c = "" Then c.Value = Format(c / userate, "0.00")
Next c
End Sub
Any help?
Regards
Robb
Thanks for that, i will give it a try. For the moment i have just created a second worksheet and linked the formulas through there. Many thanks for your help.
Denis