Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete some column headings from an autofiltered range. | Excel Worksheet Functions | |||
autofiltered cells | Excel Programming | |||
empty autofiltered range | Excel Programming | |||
Autofiltered cell value (VBA) | Excel Programming | |||
Error stepping through Autofiltered visible range | Excel Programming |