ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete rows autofilter (https://www.excelbanter.com/excel-programming/320136-delete-rows-autofilter.html)

masterphilch

delete rows autofilter
 
Hi!

Always I want to delete a Row there's an error. When I deactivte the
Autofilter it works fine. Is there a way to delete a row while the
Autofilter is activatet?

thx
masterphilch

Lonnie M.

delete rows autofilter
 
Can you supply an example of the code you use to delete rows along with
the error message?

Regards, Lonnie M.


masterphilch

delete rows autofilter
 
Rows(xy).Delete

And the Autofilter (not on the same row!) is activatet! Or do you need
some more informations?


Lonnie M. wrote:

Can you supply an example of the code you use to delete rows along with
the error message?

Regards, Lonnie M.


Lonnie M.

delete rows autofilter
 
I am still not exactly clear on what exactly you are trying to do, but
here is my response based on my best guess. See the following post (you
will need to modify to serve your needs):

############################################
############################################
############################################
Ron de Bruin Apr 6 2003, 1:32 pm

Newsgroups: microsoft.public.excel.programming
From: "Ron de Bruin" - Find messages by this
author
Date: Sun, 6 Apr 2003 22:32:24 +0200
Local: Sun, Apr 6 2003 1:32 pm
Subject: Use VBA to autofilter and then delete rows based on
blanks...

Use this one instead if they are really empty


Public Sub DeleteBlankRows()
On Error Resume Next 'In case there are no blank rows
Columns("C").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
On Error GoTo 0
End Sub
############################################
############################################
############################################

I am not sure the criteria that you are trying to use, but it is likely
that you are trying to delete based on the visible cells. If that is
the case xlCellTypeVisible should be substituted in place of
xlCellTypeBlanks.
Hopefully this gives you some direction to go in--Lonnie M.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com