Function numseul(r As Range)
Dim chiffres As String
Dim oReg As Object
Set oReg = CreateObject("vbscript.regexp")
With oReg
.Global = True
.IgnoreCase = True
.Pattern = "\D"
chiffres = .Replace(r.Text, "")
End With
numseul = Val(chiffres)
End Function
Function NumChaine(chaine)
Application.Volatile
TempChaine = Trim(Application.Substitute(chaine, ",", "."))
Temp = ""
For i = 1 To Len(TempChaine)
c = Mid(TempChaine, i, 1)
If c >= "0" And c <= "9" Or c = "." Then Temp = Temp & c
Next i
NumChaine = Val(Temp)
End Function
Function RetournerNumRef(Reference1)
Dim i As Byte, Nb As Byte
Dim Cible As String, Resultat As String
Dim Nombre As Double
Cible = Reference1
For i = 1 To Len(Cible)
If IsNumeric(Mid(Cible, i, 1)) Then
Nombre = Val(Mid(Cible, i, Len(Cible) - i + 1))
Nb = Nb + 1
Resultat = Resultat & Nombre
i = i + Len(Str(Nombre)) - 1
End If
Next
RetournerNumRef = Resultat
End Function
me rappelle plutôt un certain MichelDim Cible As String
mais j'ai fais la macro suivante
If IsNumeric(Mid(Cell.Offset(0, -1), k, 1)) Then Val = k: Exit For
If Not IsNumeric(Mid(Cell.Offset(0, -1), k, 1)) Then Val = k
=SI(ESTNUM(LC(-2):L(23)C(-2));MAX(LC(-2):L(23)C(-2));"")