Option Explicit
Sub conversion()
Dim i As Integer, j As Integer, moné As Double
With ActiveSheet
If .Range("M1").Value = "Converti" Then
MsgBox "Monnaie déjà convertie!" & vbLf & "Fin de l'opération.", vbInformation + vbOKOnly, "CONVERTION"
Exit Sub
Else
.Range("M1") = "Converti"
moné = .Range("J2").Value
For j = 4 To 15
For i = 8 To 17
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 22 To 32
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 39 To 57
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 59 To 60
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 62 To 68
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 70 To 81
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 85 To 87
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 92 To 97
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 101 To 105
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
For i = 109 To 112
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next i
i = 116
If IsEmpty(.Cells(i, j).Value) Then
.Cells(i, j).Value = ""
Else
.Cells(i, j).Value = .Cells(i, j).Value * moné
End If
Next j
MsgBox "Convertion terminée!", vbInformation + vbOKOnly, "CONVERTION DEVISE"
End If
End With
End Sub