Hi all,


I have modified a macro found on Internet for converting some values into another currency.
However, I would like to find a way to restore the previous values. How should I do?

The macro for conversion is the following:


Sub ConvertitoreRUR()

Dim Formato, TipoVal, cambioEU, Intervallo, mObj As Range

' *** Parametri Valuta e Cambio Euro ***
TipoVal = "RUR"
cambioEU = 30.27
Formato = "#,### $"
' **************************************

ActiveSheet.Range("A1").Select
Set Intervallo = Range(Cells(1, 1), Cells.SpecialCells(xlCellTypeLastCell))
For Each mObj In Intervallo
If Not IsEmpty(mObj) Then
If IsNumeric(mObj.Value) Then
If (mObj.Style = "Currency") Or (InStr(mObj.NumberFormatLocal, TipoVal) > 0) Then
form = mObj.NumberFormatLocal
n = InStr(form, TipoVal)
If n > 0 Then
mObj.NumberFormatLocal = Left(form, n - 1) + "$" + Right(form, Len(form) - n - 1)
If mObj.HasFormula = True Then mObj.Value = mObj.Value / cambioEU
End If
form = mObj.NumberFormatLocal
n = InStr(form, TipoVal)
If n > 0 Then
mObj.NumberFormatLocal = Left(form, n - 1) + "$" + Right(form, Len(form) - n - 1)
End If
If (mObj.Style = "Currency") Or (InStr(mObj.NumberFormatLocal, "$") > 0) Then mObj.NumberFormatLocal = Formato
End If
End If
End If
Next
MsgBox "Currency conversion " & TipoVal & " ->" & " $" & " completed!", vbInformation + vbOKOnly, "by xxx"
End Sub