Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Select first field whilst autofilter is on

Hi, I'm having trouble getting my macro to go to the first row which
is visible, whilst the autofilter is on.
I can get to the last row by going to the bottom of the sheet, then
using XlEndUp, but I can't use it for the top row. If I use offset, it
will select one of the hidden cells...

Any help would be appreciated.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Select first field whilst autofilter is on

Option Explicit
sub testme()
dim VRng as range
with activesheet.autofilter.range
if .columns(1).cells.specialcells(xlcelltypevisible). count = 1 then
msgbox "no visible cells
exit sub
end if
set Vrng = .columns(1).resize(.rows.count-1,1) _
.offset(1,0).cells.specialcells(xlcelltypevisible)
end with
vrng.cells(1).select
end sub

bony_tony wrote:

Hi, I'm having trouble getting my macro to go to the first row which
is visible, whilst the autofilter is on.
I can get to the last row by going to the bottom of the sheet, then
using XlEndUp, but I can't use it for the top row. If I use offset, it
will select one of the hidden cells...

Any help would be appreciated.

Thanks


--

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
Dynamic autofilter field merry_fay Excel Discussion (Misc queries) 2 March 17th 10 02:11 PM
How to select blank cells only whilst using sumproduct Romileyrunner1 Excel Worksheet Functions 1 August 20th 09 07:48 AM
Summing a Field while Using an Autofilter Lost and Looking for Help Excel Programming 1 May 24th 06 05:59 PM
Autofilter with date field gabch[_2_] Excel Programming 1 February 14th 06 11:49 AM
Selection.AutoFilter Field:=1 MBlake[_2_] Excel Programming 7 August 25th 05 08:03 PM


All times are GMT +1. The time now is 12:44 AM.

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"