Sub Pulsante2_Click()
Dim Sh As Worksheet, Fnd As Range, Parola, Elenco As Range, tX As Long, fAddr As String
With ThisWorkbook.Sheets("Foglio20")
Set Elenco = Range(.Range("M3"), .Range("M3").End(xlDown))
End With
For Each Sh In ThisWorkbook.Sheets
If Left(Sh.Name, 4) = "All_" Then
With Sh.UsedRange
For Each Parola In Elenco.Cells
Set Fnd = .Find(Parola, , xlValues, xlPart)
If Not Fnd Is Nothing Then
fAddr = Fnd.Address
Do
tX = 1
Do
tX = InStr(tX, Fnd.Value, Parola, vbTextCompare)
If tX > 0 Then
Fnd.Characters(Start:=tX, Length:=Len(Parola)).Font.FontStyle = "Corsivo"
tX = tX + Len(Parola)
End If
Loop Until tX = 0
Set Fnd = .FindNext(Fnd)
Loop Until (Fnd Is Nothing) Or (fAddr = Fnd.Address)
End If
Next Parola
End With
End If
Next Sh
Set Fnd = Nothing
Set Elenco = Nothing
End Sub |