Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RAP RAP is offline
external usenet poster
 
Posts: 49
Default AutoFilter results plus show next row

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default AutoFilter results plus show next row

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

--
regards,
Tom Ogilvy

"RAP" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
RAP RAP is offline
external usenet poster
 
Posts: 49
Default AutoFilter results plus show next row

Tom,

You are AWESOME !! Thank you so much. Works perfectly.

Randy



"Tom Ogilvy" wrote:

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

--
regards,
Tom Ogilvy

"RAP" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
emailing autofilter results Dianeg Excel Worksheet Functions 3 January 19th 10 10:02 AM
Autofilter results Ben Wunderin Excel Discussion (Misc queries) 3 December 2nd 08 12:31 AM
After autofilter my results are not visible.. Darin Kramer Excel Programming 2 August 9th 06 06:48 PM
with formulas that show negative results I want to show zero inste brit64 Excel Discussion (Misc queries) 6 August 29th 05 11:12 PM
Delete results of Autofilter??? Kobayashi[_31_] Excel Programming 4 February 18th 04 05:37 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"