Val inverse

mahor - 23 août 2001 à 12:37
 mahor - 27 août 2001 à 11:52
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

3 réponses

si tu as en a1 paris12 et que tu veux paris en b1:
en b1 tu tape =right(a1,2)
0
tente voir ça :

Soit PARIS12 en A1, pour mettre 12 en B1

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)

next i

@+
0
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

c barbare mais ca marche
merci et @+
0
Rejoignez-nous