PC Review


Reply
Thread Tools Rate Thread

Determine last row while autofilter is activated

 
 
Ixtreme
Guest
Posts: n/a
 
      15th Aug 2007
Hi,

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

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

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      15th Aug 2007
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(xlCellTypeVisible)
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 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
determine if autofilter is on =?Utf-8?B?Z2VlYmVl?= Microsoft Excel Programming 1 27th Oct 2006 11:06 PM
Determine application activated CF 2.0 =?Utf-8?B?c3luYw==?= Microsoft Dot NET Compact Framework 2 17th Jan 2006 02:51 AM
Determine Value of Autofilter Evan Microsoft Excel Misc 1 1st Jun 2005 01:02 PM
how to go the the next row when autofilter is activated =?Utf-8?B?RnJhbsOnb2lz?= Microsoft Excel Programming 1 23rd Feb 2005 12:32 AM
Recalculating Excel Sheets with activated autofilter =?Utf-8?B?QlZB?= Microsoft Excel Programming 8 10th Mar 2004 11:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:53 PM.