Re : Probleme de format des cellules
Bonjour
tu peux essayer ce code
Sub Convertir_en_numerique()
'Conversion en numérique d'un nombre exprimé en texte '
Application.ScreenUpdating = False
Application.Calculation = xlCalculationmanual
Dim Vtext As Variant
For Each Vtext In Selection
If IsEmpty(Vtext.Value) = False Then 'Traitement de la zone '
VtexVtext.Formula = CDbl(Vtext)
'or
vtext.Formula = Trim(Vtext)
End If
Next
Application.Calculation = xlCalculationautomatic
End Sub
ou celle là
Public Sub Convert_numero() 'Conversion en numérique d'un nombre exprimé en texte '
Application.ScreenUpdating = False
Dim Vlign&, Vcol&, Derlig&, Z&, Tablo
'Vcol =Colonne active , vlign =Ligne active, Derli dernière ligne de la plage
Vcol = 1: Vlign = 2
Derlig = Cells(65536, Vcol).End(xlUp).Row
With ActiveSheet
Tablo = ActiveSheet.Cells(Vlign, Vcol).Resize(Derlig, Vcol).Value
For Z = LBound(Tablo, 1) To UBound(Tablo, 1)
'Traitement de la zone
Tablo(Z, 1) = CDbl(Tablo(Z, 1))
Next
ActiveSheet.Cells(Vlign, Vcol).Resize(Derlig - 1, Vcol) = Tablo
'MsgBox "Ok"
End With
Erase Tablo
Cells(2, 1).Select
End Sub