Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Autofilter question

I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
Boo Boo is offline
external usenet poster
 
Posts: 21
Default Autofilter question

Mike,

Try this:

For a = 20 To 1 Step -1
If Rows(a).Hidden = True Then
Rows(a).EntireRow.Delete
End If
Next a

Obviosuly it's a small example of the syntax - change the way you scroll
through the rows as you see fit.

"MikeG22" wrote:

I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Autofilter question

Change the AutoFilter criteria

= criteria to
< criteria

http://www.rondebruin.nl/delete.htm#AutoFilter

then use DeleteValue = "<ron"




--
Regards Ron de Bruin
http://www.rondebruin.nl



"MikeG22" wrote in message ...
I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Autofilter question

I've tried this and it seems the autofiltered rows are not showing up with
Hidden = true so this won't work... :(

"Boo" wrote:

Mike,

Try this:

For a = 20 To 1 Step -1
If Rows(a).Hidden = True Then
Rows(a).EntireRow.Delete
End If
Next a

Obviosuly it's a small example of the syntax - change the way you scroll
through the rows as you see fit.

"MikeG22" wrote:

I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?

  #5   Report Post  
Posted to microsoft.public.excel.programming
Boo Boo is offline
external usenet poster
 
Posts: 21
Default Autofilter question

Mike,

Strange - I tried this before posting and it worked fine...sorry. No other
suggestions :-(

"MikeG22" wrote:

I've tried this and it seems the autofiltered rows are not showing up with
Hidden = true so this won't work... :(

"Boo" wrote:

Mike,

Try this:

For a = 20 To 1 Step -1
If Rows(a).Hidden = True Then
Rows(a).EntireRow.Delete
End If
Next a

Obviosuly it's a small example of the syntax - change the way you scroll
through the rows as you see fit.

"MikeG22" wrote:

I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Autofilter question

I'm sorry, that does work. Thanks!

"Boo" wrote:

Mike,

Try this:

For a = 20 To 1 Step -1
If Rows(a).Hidden = True Then
Rows(a).EntireRow.Delete
End If
Next a

Obviosuly it's a small example of the syntax - change the way you scroll
through the rows as you see fit.

"MikeG22" wrote:

I am trying to programatically delete all rows that have been filtered out
with an autofilter in an excel spreadsheet. I can find a lot of examples of
how to delete rows that have not been filtered out, but I want all "hidden"
rows deleted.

Any ideas?

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
Autofilter Question kate Excel Discussion (Misc queries) 0 April 25th 08 07:13 PM
Autofilter Question veryeavy Excel Discussion (Misc queries) 0 April 24th 08 02:00 AM
AutoFilter Question AccessHelp Excel Discussion (Misc queries) 2 September 29th 06 09:25 PM
Autofilter Question David Excel Programming 0 May 18th 06 07:49 AM
AutoFilter question Alex Sossick Excel Programming 0 January 21st 04 05:07 PM


All times are GMT +1. The time now is 05:27 PM.

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"