Hi, I use this code to select all Rows that contain number 3 based on column F. The code will select the Entire Row. But what I really want is the Rows contain number 3 to be selected only until Column X, not the entire Row. How can I do that ?
Code:
Sub SelRows()
Dim ocell As Range
Dim rng As Range
For Each ocell In Range("F:F")
If ocell.Value = "3" Then
If rng Is Nothing Then
Set rng = ocell.EntireRow
Else
Set rng = Union(rng, ocell.EntireRow)
End If
End If
Next
If Not rng Is Nothing Then rng.Select
Set rng = Nothing
Set ocell = Nothing
End Sub
Last edited: