Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Problem with code

OK i have a macro that does an auto filter and counts takes the results and
pastes the rows that i have set over to another page. The probelm is that
when the auto filter come back with ne results it pastes everthing. What can
i do to stop this?

I have tried counting before the filter and after and comparing the totals
and do if = then exit sub with no luck.
I have tried a msgbox with a yes no and that didnt work.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem with code

You can count how many visible cells are shown in column 1 of the autofilter
range. The headers will always be visible, so check for more than 1.

with activesheet.autofilter.range
if .columns(1).cells.specialcells(xlcelltypevisible). cells.count = 1 then
'only headers are visible
'do nothing???
else
'do what you want
end if
end with

"jln via OfficeKB.com" wrote:

OK i have a macro that does an auto filter and counts takes the results and
pastes the rows that i have set over to another page. The probelm is that
when the auto filter come back with ne results it pastes everthing. What can
i do to stop this?

I have tried counting before the filter and after and comparing the totals
and do if = then exit sub with no luck.
I have tried a msgbox with a yes no and that didnt work.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


--

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
If/then code problem peter.thompson[_12_] Excel Programming 2 December 27th 05 03:19 AM
Problem with Code Below Ben H Excel Programming 7 February 25th 05 08:30 PM
Problem with the following code Vince Excel Programming 3 November 19th 04 08:51 AM
code problem scrabtree23[_2_] Excel Programming 2 September 16th 04 05:28 AM
VBA code problem excelnoob[_2_] Excel Programming 1 July 5th 04 01:31 PM


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