Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Error, when autofilter does not return visible rows

Thanks, this helped ...

"Dave Peterson" wrote:

I like to count the number of visible rows.

if activesheet.autofilter.range _
.columns(1).cells.specialcells(xlcelltypevisible) = 1 then
'only headers, no data
else
'there's something there, do the stuff
end if
end with



Axel wrote:

Hi,
I have following problem: I'm using Autofilter to select data from a sheet
and transfer it a different sheet. Unfortunally, when no data is found by
autofilter I get following error message on 3rd line of the following code:
"Run time error 1004 - no cells were found".
Does anybody have an idea how to avoid this error?

Range(Cells(2, 1), Cells(No_Rows_Source, 1)).Select
Set Rng = Selection
Set RngVis = Rng.SpecialCells(xlVisible)
For Each Cll In RangVis
.....
Next

Kind regards, AXEL


--

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
Excel copy only visible rows from autofilter duketter Excel Discussion (Misc queries) 2 June 30th 08 10:55 PM
Autofilter: jump from visible row to visible row by command button [email protected] Excel Programming 0 November 4th 06 09:04 PM
countif for only visible rows when combined with autofilter - possible? johli Excel Discussion (Misc queries) 1 September 21st 05 08:23 AM
AutoFilter: Loop Thru Visible Rows? Damian Carrillo[_2_] Excel Programming 2 July 21st 05 01:16 AM
AutoFilter - which rows are currently visible? Bjørnar Hartviksen Excel Programming 2 October 6th 03 12:01 AM


All times are GMT +1. The time now is 09:25 PM.

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"