je ch un fonction qui puisse extraire les valeurs d'une chaine de caractere contenu dans un cellule excel pour les inserer dans la cellule a cote
Exemeple PARIS12 doit ecrire 12 dans la cellule a cote
MERCI
for i = 1 to len(range("a1").formular1c1)
if mid$(range("a1").formular1c1,i,1) > 0 and mid$(range("a1").formular1c1,i,1) < 9 then range("b1").formular1c1=range("b1").formular1c1 & mid$(range("a1").formular1c1,i,1)
mais apres avoir laisse ce message je crois avoir trouver une solution a mon probleme :
Dim t
Dim cel1, cel_Final As String
Dim test As String
Dim MyLen1, MyLen2 As String
t = 1
cel1 = AppExcel.Worksheets(1).Cells(1, 3).Value
Do While cel1 <> ""
cel1 = AppExcel.Worksheets(1).Cells(t, 3).Value
test = Val(StrReverse(cel1))
MyLen1 = Len(cel1)
MyLen2 = Len(test)
If cel1 = "" Then GoTo ici:
' si il n'y a pas encore de Document en cree un
If AppExcel.Workbooks.Count = 0 Then
AppExcel.Workbooks.Add
End If
cel_Final = Mid(cel1, 1, MyLen1 - MyLen2)
With AppExcel.Worksheets(1).Cells(t, (3 - 1))
.Value = StrReverse(test)
End With
With AppExcel.Worksheets(1).Cells(t, 3)
.Value = cel_Final
End With
t = t + 1
Loop