pelw
Messages postés148Date d'inscriptiondimanche 12 janvier 2003StatutMembreDernière intervention14 février 20056 30 oct. 2003 à 11:39
Essaye ceci (en admettant que le texte concerné se trouve dans la cellule A1 de la feuille "Feuil1") :
Sub Main()
Dim iChar As Integer
Dim bBold As Boolean
Dim sText As String
With Worksheets("Feuil1").Range("A1")
For iChar = 1 To Len(.Text)
If .Characters(iChar, 1).Font.Bold = True Then
If Not bBold Then
bBold = True
sText = sText & ""
End If
Else
If bBold Then
bBold = False
sText = sText & ""
End If
End If
sText = sText & Mid(.Text, iChar, 1)
Next
If bBold Then
sText = sText & "</gras>"
End If
MsgBox "Texte cellule : " & .Text & vbCrLf & "Texte extrait : " & sText
End With