GARRY77
30-11-2004, 23:19
Ho trovato questa macro che trasforma da lire in euro in foglio excel...
Qualcuno puo' aiutarmi a fargli fare il contrario?
da euro in lire?
Grazie mille, non mastico tantissimo vb
Sub EuroConvertitore()
Dim Formato, TipoVal, cambioEU, Intervallo, mObj As Range
' *** Parametri Valuta e Cambio Euro ***
TipoVal = "L."
cambioEU = 1936.27
Formato = "#.##0,00 €"
' **************************************
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 = False 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
End Sub
Qualcuno puo' aiutarmi a fargli fare il contrario?
da euro in lire?
Grazie mille, non mastico tantissimo vb
Sub EuroConvertitore()
Dim Formato, TipoVal, cambioEU, Intervallo, mObj As Range
' *** Parametri Valuta e Cambio Euro ***
TipoVal = "L."
cambioEU = 1936.27
Formato = "#.##0,00 €"
' **************************************
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 = False 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
End Sub