AutoFilter results plus show next row

G

Guest

Hello All:

I would like to take the results of an AutoFilter and have it show the
normal results plus the next row of each result.

Ex:
Unfiltered Page: Rows 1 - 20
Typical AutoFilter result: Rows 2, 10, 15
Desired AutoFilter result: Rows 2,3,10,11,15 & 16

Uber Thanks for any help or direction,
Randy
 
G

Guest

Sub ShowRows()
Dim rng As Range, i As Long
Set rng = ActiveSheet.AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1, 1)
For i = rng(rng.Count).Row To rng.Row Step -1
If rng(i - rng.Row + 1).EntireRow.Hidden = False Then
rng(i - rng.Row + 2).EntireRow.Hidden = False
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top