Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Determine last row while autofilter is activated

Hi,

How can I quickly determine the last row on my sheet while autofilter
is still active?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Determine last row while autofilter is activated

Does something like this not work?

Dim aWS As Worksheet
Dim lRow as long

Set aWS = ActiveSheet

Set myrange = aWS.Rows(aWS.Rows.Count)
lrow = myrange.End(xlUp).Row
Debug.Print lrow


"Ixtreme" wrote:

Hi,

How can I quickly determine the last row on my sheet while autofilter
is still active?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Determine last row while autofilter is activated

You could look at the last visible area and then look at the last cell in that
area:

Option Explicit
Sub testme()

Dim myRng As Range
Dim myRow As Long

With Worksheets("sheet1")
With .AutoFilter.Range.Columns(1).Cells.SpecialCells(xl CellTypeVisible)
With .Areas(.Areas.Count)
myRow = .Cells(.Cells.Count).Row
End With

MsgBox myRow

'maybe a check
If myRow = .Row Then
MsgBox "only headers are visible"
End If
End With
End With

End Sub


Ixtreme wrote:

Hi,

How can I quickly determine the last row on my sheet while autofilter
is still active?


--

Dave Peterson
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
VBA: determine if value is invisible in autofilter Tamar Excel Programming 2 March 30th 07 07:08 PM
determine if autofilter is on geebee Excel Programming 1 October 27th 06 11:06 PM
Determine Value of Autofilter Evan Excel Discussion (Misc queries) 1 June 1st 05 01:02 PM
how to go the the next row when autofilter is activated François Excel Programming 1 February 23rd 05 12:32 AM
Recalculating Excel Sheets with activated autofilter BVA Excel Programming 1 March 5th 04 10:29 AM


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