OMG! You rock
Super votre plugin.
Je prend avec joie, je vous remerci infiniments.
Avez vous quelque indice ou information sur la façon d'ajouter des mot clé et les codes couleurs.
Je n'est perçu aucune bibliothèque de mot ni de code Hexa ou RGB ???
Je ne connais pas trop la syntaxe VBA
Option Explicit
Sub colorSel()
colorer Selection
End Sub
Sub colorer(plage As Range)
'colorer mots clé de la plage
Dim shL As Worksheet, motscle
Dim c As Range, lig As Long
Dim ch As String, ch2 As String, pos As Long, lch As Long
Set shL = Sheets("Listes")
motscle = shL.[A1].Resize(shL.Cells(Rows.Count, 1).End(xlUp).Row, 2).Value
For lig = 2 To UBound(motscle)
motscle(lig, 2) = shL.Cells(lig, 1).Font.color
Next lig
For Each c In plage
ch = c.Value
lch = Len(ch)
For lig = 2 To UBound(motscle)
pos = InStr(ch, motscle(lig, 1))
Do While pos > 0
c.Characters(Start:=pos, Length:=Len(motscle(lig, 1))).Font.color = motscle(lig, 2)
If pos > 1 Then ch2 = Left(ch, pos - 1) Else ch2 = ""
ch = ch2 & Application.Rept("µ", Len(motscle(lig, 1))) & IIf(pos + Len(motscle(lig, 1)) < lch, Mid(ch, pos + Len(motscle(lig, 1))), "")
pos = InStr(ch, motscle(lig, 1))
Loop
Next lig
Next c
End Sub
[size=150]EDIT: Laisser faire mon ami, j'avai lit trop rapidement la petite , bulle , tous est impecable.
Un grand merci[/size]