Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Delete Rows Filtered within Auto Filter

Hi...

I have 3000 records. I want to delete 300 rows that share an auto filtered
value. The problem of course is that when I highlight the block to delete, it
deletes the rows that have't been filtered. Is there a way round this?

Thanks

Gordon...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Delete Rows Filtered within Auto Filter

Hi Gordon,

Try:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range

Set WB = Workbooks("YourBook.xls") '<<=== CHANGE
Set SH = WB.Sheets("Sheet1") '<<=== CHANGE

On Error Resume Next
Set Rng = SH.AutoFilter.Range
Set Rng = Rng.Offset(1).Resize(Rng.Rows.Count - 1)
Set Rng = Rng.SpecialCells(xlVisible)
On Error GoTo 0

If Not Rng Is Nothing Then
Rng.EntireRow.Delete
End If
End Sub
'<<=============

You could also perform the operation manually:

Select cells to be deleted
F5 | Special | Visibile cells
Right-click | Delete | Entire row


---
Regards,
Norman



"Gordon" wrote in message
...
Hi...

I have 3000 records. I want to delete 300 rows that share an auto filtered
value. The problem of course is that when I highlight the block to delete,
it
deletes the rows that have't been filtered. Is there a way round this?

Thanks

Gordon...



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
Can you apply the auto filter to data that are filtered? Skip in FL Excel Worksheet Functions 4 January 7th 09 02:58 AM
How do I get Auto filter to report number of records filtered? Walldorc Setting up and Configuration of Excel 1 December 17th 08 03:09 PM
using auto filter, how to tell what columns are filtered? Robert Mark Bram Excel Discussion (Misc queries) 5 August 25th 08 01:08 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated robertjtucker[_8_] Excel Programming 1 September 29th 05 05:47 PM


All times are GMT +1. The time now is 02:01 AM.

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"