PC Review


Reply
Thread Tools Rate Thread

AutoFilter results plus show next row

 
 
=?Utf-8?B?UkFQ?=
Guest
Posts: n/a
 
      7th Aug 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      7th Aug 2007
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 With Quote
 
=?Utf-8?B?UkFQ?=
Guest
Posts: n/a
 
      7th Aug 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilter results Ben Wunderin Microsoft Excel Misc 3 2nd Dec 2008 12:31 AM
Using autofilter results =?Utf-8?B?Q2xlYmVyIEluYWNpbw==?= Microsoft Excel Programming 1 18th Nov 2007 07:11 PM
Count of results in AutoFilter andrew Microsoft Excel Programming 3 2nd Oct 2004 12:45 AM
Autofilter results Microsoft Excel Misc 0 23rd Sep 2003 10:39 PM
Autofilter results Microsoft Excel Misc 2 23rd Sep 2003 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 AM.