maval
XLDnaute Barbatruc
Bonjour,
Suite à l’excellent code de Job que je salut et remercie au passage. J’ai un code associer au sien pour changer des mots, tel que : Polygon ou Points= » mon code est celui-ci :
Avec ce code j'obtiens ceci:
<path id="L'ABERGEMENT-SAINTE-COLOMBE" " d="M390.7,432.1 351.5,409.9 341.6,428.7 297.5,406.6 302.3,396.8……………..
Alors que j'aimerais obtenir ceci
<path id="01" title="L'Abergement-Sainte-Colombe" d="M390.7,432.1 351.5,409.9 341.6,428.7 297……………………….
Je joint mon fichier qui seras plus explicite.
je vous remercie
max
Suite à l’excellent code de Job que je salut et remercie au passage. J’ai un code associer au sien pour changer des mots, tel que : Polygon ou Points= » mon code est celui-ci :
Code:
Sub remplace()
col = "F"
Columns(col).Replace "<polygon id=", "<path id=", xlPart
Columns(col).Replace "points=""", "d=""M", xlPart
Columns(col).Replace "_2_", "", xlPart
Columns(col).Replace "_x27_", "'", xlPart
For i = 1 To Cells(Rows.Count, col).End(xlUp).Row
t = Cells(i, col)
texte = t
If texte <> "" Then
texte = Split(texte, """")(1)
texte = Split(texte, "_")
texte = texte(UBound(texte))
If EstMajuscule(texte) Then Cells(i, 1) = texte
End If
texte = t
If texte <> "" Then
s = InStr(texte, "_x37_1")
If s > 0 Then
s1 = InStr(s + 6, texte, "_")
texte = Left(t, s - 1) & Mid(texte, s1 + 1)
Cells(i, col) = texte
End If
End If
Next i
Min
SupprimerMot
End Sub
Function EstMajuscule(tx)
t = tx
For i = 1 To Len(t)
ch = Mid(t, i, 1)
If (ch < "A" Or ch > "Z") And ch <> "-" And ch <> "'" Then EstMajuscule = False: Exit Function
Next i
EstMajuscule = True
End Function
Avec ce code j'obtiens ceci:
<path id="L'ABERGEMENT-SAINTE-COLOMBE" " d="M390.7,432.1 351.5,409.9 341.6,428.7 297.5,406.6 302.3,396.8……………..
Alors que j'aimerais obtenir ceci
<path id="01" title="L'Abergement-Sainte-Colombe" d="M390.7,432.1 351.5,409.9 341.6,428.7 297……………………….
Je joint mon fichier qui seras plus explicite.
je vous remercie
max