VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello all,
I have the code below that works great to select whatever is the first cell is but also want to select the 5 cells to the right
Thanks!
I have the code below that works great to select whatever is the first cell is but also want to select the 5 cells to the right
VBA Code:
Sub Select_1stRow_in_Filter()
Dim rFiltered As Range
With ActiveSheet.AutoFilter.Range
Set rFiltered = .Resize(.Rows.count - 1).Offset(1).Columns(2).SpecialCells(xlCellTypeVisible)
End With
'first cell:
rFiltered.Cells(1, 1).Select '< ALSO SELECT THE 5 CELLS AFTER THE SELECTED CELL
'I tried this but it didn't work...
'first cell:
rFiltered.Resize(.Columns.count + 5).Cells(1, 1).Select
End Sub
Thanks!