Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Top of AutoFiltered Range?

Here's a little "snip" of code:

Windows("GOTU_Earn_Bal_2001_02 .xls").Activate
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="HDQ"
Selection.SpecialCells(xlCellTypeVisible).Select
Set rngSelection = Range(Range("C2").End(xlUp), Range("C2").End(xlDown))

The first four lines do wxactly what I want them to. Obviously the fifth
line does not. What I want is to go to the top of the visible selection. This
is dealing with about 500 Rows out of 60,000, so for speed and efficiency, I
want to do a For Each intRow through only the visible Rows.

Is there a way to do this?
--
Dave
Temping with Staffmark
in Rock Hill, SC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Top of AutoFiltered Range?

If I understand you correct ?

Maybe this will help to select the first visible data cell

First cell of the selection is a header

Sub Test()
Dim rng As Range

With Selection
.AutoFilter Field:=1, Criteria1:="HDQ"
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count) _
.SpecialCells(xlCellTypeVisible).Cells(1)
rng.Select
On Error GoTo 0
End With
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave Birley" wrote in message ...
Here's a little "snip" of code:

Windows("GOTU_Earn_Bal_2001_02 .xls").Activate
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="HDQ"
Selection.SpecialCells(xlCellTypeVisible).Select
Set rngSelection = Range(Range("C2").End(xlUp), Range("C2").End(xlDown))

The first four lines do wxactly what I want them to. Obviously the fifth
line does not. What I want is to go to the top of the visible selection. This
is dealing with about 500 Rows out of 60,000, so for speed and efficiency, I
want to do a For Each intRow through only the visible Rows.

Is there a way to do this?
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Top of AutoFiltered Range?

Slicker 'n a pig in poop! Thanks a gang.
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Ron de Bruin" wrote:

If I understand you correct ?

Maybe this will help to select the first visible data cell

First cell of the selection is a header

Sub Test()
Dim rng As Range

With Selection
.AutoFilter Field:=1, Criteria1:="HDQ"
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count) _
.SpecialCells(xlCellTypeVisible).Cells(1)
rng.Select
On Error GoTo 0
End With
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave Birley" wrote in message ...
Here's a little "snip" of code:

Windows("GOTU_Earn_Bal_2001_02 .xls").Activate
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="HDQ"
Selection.SpecialCells(xlCellTypeVisible).Select
Set rngSelection = Range(Range("C2").End(xlUp), Range("C2").End(xlDown))

The first four lines do wxactly what I want them to. Obviously the fifth
line does not. What I want is to go to the top of the visible selection. This
is dealing with about 500 Rows out of 60,000, so for speed and efficiency, I
want to do a For Each intRow through only the visible Rows.

Is there a way to do this?
--
Dave
Temping with Staffmark
in Rock Hill, SC


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
Delete some column headings from an autofiltered range. Champ Excel Worksheet Functions 1 February 17th 10 06:39 AM
autofiltered cells minostrada Excel Programming 1 November 7th 05 01:51 PM
empty autofiltered range Stefi Excel Programming 3 July 27th 05 03:08 PM
Autofiltered cell value (VBA) Jaro Excel Programming 1 August 25th 04 11:48 AM
Error stepping through Autofiltered visible range Ed[_9_] Excel Programming 2 January 15th 04 05:34 PM


All times are GMT +1. The time now is 02:08 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"