Option Explicit
Sub Essai()
Dim R As Range, T()
Set R = ActiveSheet.[C4:P4].Resize(ActiveSheet.[C4].End(xlDown).Row - 3)
RemplaceStrDbl R.Columns(6)
RemplaceStrCur R.Columns(8)
RemplaceStrCur R.Columns(12)
End Sub
Sub RemplaceStrCur(ByVal R As Range)
Dim T(), L As Long
On Error Resume Next
T = R.Value
For L = 1 To UBound(T, 1)
Err.Clear
Select Case VarType(T(L, 1))
Case vbString: T(L, 1) = CCur(Replace(T(L, 1), ".", ""))
If Err Then
Application.Goto R.Cells(L, 1)
If MsgBox("""" & T(L, 1) & """ non convertible en Currency." _
& vbLf & Err.Description & vbLf & "Voulez-vous continuer ?", _
vbExclamation + vbYesNo, "RemplacerStrCur") = vbNo Then End
End If
Case vbDouble: T(L, 1) = CCur(T(L, 1)): End Select
Next L
R.Value = T
End Sub
Sub RemplaceStrDbl(ByVal R As Range)
Dim T(), L As Long
On Error Resume Next
T = R.Value
For L = 1 To UBound(T, 1)
Err.Clear
Select Case VarType(T(L, 1))
Case vbString: T(L, 1) = CDbl(Replace(T(L, 1), ".", ""))
If Err Then
Application.Goto R.Cells(L, 1)
If MsgBox("""" & T(L, 1) & """ non convertible en Double." _
& vbLf & Err.Description & vbLf & "Voulez-vous continuer ?", _
vbExclamation + vbYesNo, "RemplacerStrDbl") = vbNo Then End
End If
Case vbCurrency: T(L, 1) = CDbl(T(L, 1)): End Select
Next L
R.Value = T
End Sub