Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated


That is what I got, I always use the auto filter method to delete rows
but this time I have a sheet that is 41000 rows long and I guess sinc
there are so many rows to be deleted it decided it was to hard. So wha
it will do is just delete everything in the filter. Strange i haven'
had that happen before. So does anyone have or know of an alternativ
way to delete rows by criteria, that would be of mass fashion not lin
by line, I have tried a few of those and it would take all day long t
do that.
Thanks for the help,
Bo

--
robertjtucke
-----------------------------------------------------------------------
robertjtucker's Profile: http://www.excelforum.com/member.php...fo&userid=2180
View this thread: http://www.excelforum.com/showthread.php?threadid=47178

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated


"robertjtucker"
wrote in message
news:robertjtucker.1w4oek_1128009950.246@excelforu m-nospam.com...

That is what I got, I always use the auto filter method to delete rows,
but this time I have a sheet that is 41000 rows long and I guess since
there are so many rows to be deleted it decided it was to hard. So what
it will do is just delete everything in the filter. Strange i haven't
had that happen before. So does anyone have or know of an alternative
way to delete rows by criteria, that would be of mass fashion not line
by line, I have tried a few of those and it would take all day long to
do that.
Thanks for the help,
Bob


--
robertjtucker
------------------------------------------------------------------------
robertjtucker's Profile:

http://www.excelforum.com/member.php...o&userid=21805
View this thread: http://www.excelforum.com/showthread...hreadid=471783


One way....ensure all cells in your range have a value then HIDE what you
want to keep and delete all remaining visible rows within the range:

<snipped from larger macro filtering data to just those records occuring
within last month
'ensure all rows have a date
finalrow = range("B65536").End(xlUp).Row
With Range("B1:B" & finalrow)
..SpecialCells(xlCellTypeBlanks).Value = 0
..NumberFormat = "mm-dd-yy"
End With

'hide last month's data then delete all remaining visible rows within the
data range
BOM = "<" & DateSerial(Year(Now), Month(Now) - 1, 1)
EOM = "" & DateSerial(Year(Now), Month(Now), 0)
With Range(Cells(1, 1), Cells(finalrow, 7))
..AutoFilter Field:=2, Criteria1:=BOM, Operator:=xlOr, Criteria2:=EOM
..Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count) _
..SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
ActiveSheet.AutoFilterMode = False 'turn off autofilter

<end snip


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
Auto Filter Does Not Work Michelle Excel Discussion (Misc queries) 3 August 27th 08 05:34 PM
Auto Number the Rows of Auto Filter Result ashish128 Excel Discussion (Misc queries) 3 April 29th 07 06:41 PM
Auto Filter by Criteria Bunson Excel Worksheet Functions 1 June 7th 06 11:03 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
Auto Filter will not work in a new worksheet jess Excel Worksheet Functions 1 November 24th 04 11:09 AM


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