Public tablo()
[B]Function DepensesDirectes1()[/B]
ReDim tablo(0)
'With Sheets("DépensesPersonnel BS")
'For i = 19 To 499
With Sheets("DépensesPersonnel BS")
For i = 1 To 10
If .Cells(i, "S") = "oui" Then
liste = liste & .Cells(i, "T") & " " & .Cells(i, "R") & " ; "
tablo(UBound(tablo)) = .Cells(i, "T")
ReDim Preserve tablo(UBound(tablo) + 1)
End If
Next i
End With
DepensesDirectes1 = Left(liste, Len(liste) - 3)
End Function
[B]Sub gras()[/B]
With Sheets("demande pj")
Range("A5") = DepensesDirectes1
Range("A5").Value = Range("A5").Value
Range("A5").Font.FontStyle = "Normal"
debut = 1
For n = LBound(tablo) To UBound(tablo) - 1
x = InStr(debut, Range("A5").Value, tablo(n))
l = Len(tablo(n))
MsgBox (tablo(n) & " " & x & " " & l)
Range("A5").Characters(Start:=x, Length:=l).Font.FontStyle = "Gras"
debut = x + 1
Next
End With
End Sub