Sub selectionCell()
Dim Cell As Range
Dim Plage As Range
' Pour chaque cellule de la plage
For Each Cell In Range("A1:A15")
' Si la cellule n'est pas vide
If Cell.Value <> "" Then
' Si le dernier caractère est "D"
If UCase(Right(Cell.Value, 1)) = "D" Then
' Sélection de la plage
If Plage Is Nothing Then
Set Plage = Cell
Else
Set Plage = Application.Union(Plage, Cell)
End If
End If
End If
Next Cell
' Sélection de la plage de cellules
If Not Plage Is Nothing Then Plage.Select
End Sub
Sub UnionSelectD()
Dim plg As Range
Dim i As Long
With Worksheets(1).Range("a1:a500")
For i = 1 To .Rows.Count
If .Cells(i, 1) Like "*D" Then
If plg Is Nothing Then
Set plg = .Cells(i, 1)
Else
Set plg = Union(plg, .Cells(i, 1))
End If
End If
Next i
End With
If Not plg Is Nothing Then plg.Select
End Sub