on the below code. I select row on condition.
I need to use union to select all these rows with the below condition.
I know that my code can be changed completely by using arrays,
but for a learning purpose, how union can be used to do the same action?
In advance grateful for useful comments and answer.
Sub Union_Test()
Dim ws As Worksheet: Set ws = ActiveSheet
Dim lastR As Long: lastR = ws.Cells(Rows.Count, 1).End(xlUp).Row
Dim cel As Range, rng As Range, srg As Variant
Set rng = ws.Range("V3:V" & lastR)
For Each cel In rng
If cel.value = "Yes" Then
cel.EntireRow.Select
End If
Next cel
' I need here to use union to select all (cel.EntireRow)
End Sub