PC Review


Reply
Thread Tools Rate Thread

Auto-filter. Cursor on first row in new list

 
 
John
Guest
Posts: n/a
 
      19th Feb 2007
Hi,

Is there any way to get the cursor to go to the first row of a filtered list
when Autofilter is used?

Thanks,

John


 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      19th Feb 2007
Dim rng as Range, rng1 as range
set rng = Activesheet.Autofilter.Range.Columns(1).Cells
set rng = rng.offset(1,0).Resize(rng.rows.count - 1)
on error resume next
set rng1 = rng.SpecialCells(xlVisible)
On error goto 0
if not rng1 is Nothing then
rng1(1).Select
end if

--
Regards,
Tom Ogilvy


"John" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> Is there any way to get the cursor to go to the first row of a filtered
> list when Autofilter is used?
>
> Thanks,
>
> John
>



 
Reply With Quote
 
John
Guest
Posts: n/a
 
      19th Feb 2007
Thanks Tom. Where would I put this code to have it run when I use the
AutoFilter drop down list on the worksheet?

John

"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dim rng as Range, rng1 as range
> set rng = Activesheet.Autofilter.Range.Columns(1).Cells
> set rng = rng.offset(1,0).Resize(rng.rows.count - 1)
> on error resume next
> set rng1 = rng.SpecialCells(xlVisible)
> On error goto 0
> if not rng1 is Nothing then
> rng1(1).Select
> end if
>
> --
> Regards,
> Tom Ogilvy
>
>
> "John" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi,
>>
>> Is there any way to get the cursor to go to the first row of a filtered
>> list when Autofilter is used?
>>
>> Thanks,
>>
>> John
>>

>
>



 
Reply With Quote
 
John
Guest
Posts: n/a
 
      19th Feb 2007
I combined your suggestion with this:
http://www.excelforum.com/archive/in.../t-503428.html

And it works fine. Thank you.


"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dim rng as Range, rng1 as range
> set rng = Activesheet.Autofilter.Range.Columns(1).Cells
> set rng = rng.offset(1,0).Resize(rng.rows.count - 1)
> on error resume next
> set rng1 = rng.SpecialCells(xlVisible)
> On error goto 0
> if not rng1 is Nothing then
> rng1(1).Select
> end if
>
> --
> Regards,
> Tom Ogilvy
>
>
> "John" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi,
>>
>> Is there any way to get the cursor to go to the first row of a filtered
>> list when Autofilter is used?
>>
>> Thanks,
>>
>> John
>>

>
>



 
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
auto filter list selection Seeker Microsoft Excel Programming 19 23rd May 2009 06:42 AM
Auto Filter List jfcby Microsoft Excel Programming 5 4th May 2009 01:19 PM
Auto-filter by cursor location whatisit Microsoft Excel Discussion 7 9th Jul 2008 03:30 AM
Auto list/filter =?Utf-8?B?U2NvdHQgTWFyY3Vz?= Microsoft Excel Misc 0 31st Oct 2006 05:23 PM
Auto Filter From List =?Utf-8?B?SmFtZXMgU3RlcGhlbnM=?= Microsoft Excel Programming 0 28th Jan 2004 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:31 PM.