1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Sub Selection()
Dim r As Range, ff As String, x As Range
'le format recherché
With Application.FindFormat
.Clear
.Font.ColorIndex = 5
End With
With Sheets("Feuil1")
Set r = .Cells.Find("*", SearchFormat:=True)
If Not r Is Nothing Then
ff = r.Address
Do
If x Is Nothing Then
Set x = r
Else
Set x = Union(x, r)
End If
Set r = .Cells.Find("*", r, SearchFormat:=True)
Loop Until ff = r.Address
End If
End With
If Not x Is Nothing Then
x.Select
Else
MsgBox "Pas de cellules au format recherché"
End If
End Sub |
Partager