Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Macros with AutoFiltering

If I have Autofiltering turned on, how can I tell from within a macro which
lines are selected?

for i = 1 to nRows
if row i is displayed then ....
next i


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Macros with AutoFiltering

Check the row height - filtering just sets the height to
zero to hide the row.

For i = 1 to nRows
If Sheets(MySheet).Rows(i).RowHeight 0 Then...
Next i

-----Original Message-----
If I have Autofiltering turned on, how can I tell from

within a macro which
lines are selected?

for i = 1 to nRows
if row i is displayed then ....
next i


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Macros with AutoFiltering

Thanks for the reply. It answered the question and I got my code written.
However, I think I could have asked the question in a better way and
learned more. If I have autofiltering turned on, how can I write code to
acccomplish:

For each displayed row
Do something
Next displayed row

Thanks again.

On Fri, 16 Apr 2004 09:31:31 -0700, "K Dales"
wrote:

Check the row height - filtering just sets the height to
zero to hide the row.

For i = 1 to nRows
If Sheets(MySheet).Rows(i).RowHeight 0 Then...
Next i

-----Original Message-----
If I have Autofiltering turned on, how can I tell from

within a macro which
lines are selected?

for i = 1 to nRows
if row i is displayed then ....
next i


.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Macros with AutoFiltering

This code increments down the visible cells in an AutoFiltered list. Wish I
could take credit, but I'm nowhere near that smart! Tom Ogilvy gave it to
me.

Sub Increment1()
Dim rng As Range, rng1 As Range
Dim icol As Long
icol = ActiveCell.Column
Set rng = ActiveSheet.AutoFilter.Range
Set rng = Intersect(rng, Columns(icol))
Set rng = Range(ActiveCell.Offset(1, 0), rng(rng.Count))
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
If Not rng1 Is Nothing Then
rng1(1).Select
End If
End Sub

Ed
wrote in message
...
Thanks for the reply. It answered the question and I got my code written.
However, I think I could have asked the question in a better way and
learned more. If I have autofiltering turned on, how can I write code to
acccomplish:

For each displayed row
Do something
Next displayed row

Thanks again.

On Fri, 16 Apr 2004 09:31:31 -0700, "K Dales"
wrote:

Check the row height - filtering just sets the height to
zero to hide the row.

For i = 1 to nRows
If Sheets(MySheet).Rows(i).RowHeight 0 Then...
Next i

-----Original Message-----
If I have Autofiltering turned on, how can I tell from

within a macro which
lines are selected?

for i = 1 to nRows
if row i is displayed then ....
next i


.




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
Autofiltering again computexcel Excel Discussion (Misc queries) 6 September 14th 08 09:11 PM
autofiltering Bernie R Excel Worksheet Functions 1 February 7th 08 10:13 PM
AutoFiltering Mennochio Excel Discussion (Misc queries) 1 September 15th 06 08:08 PM
autofiltering Reggiee Excel Discussion (Misc queries) 2 August 2nd 06 04:32 PM
Autofiltering [email protected] Excel Discussion (Misc queries) 2 October 4th 05 02:44 PM


All times are GMT +1. The time now is 05:59 PM.

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

About Us

"It's about Microsoft Excel"