Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default deleting various rows of cell data throughout the master list tha.

I have an ~30,000 row master list, which contains 3,000 (noncontiguous) rows
of false information. I have compiled a list of the false data on a separate
worksheet. How do I efficiently match the two lists and delete the
corresponding false information from the master?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default deleting various rows of cell data throughout the master list tha.

Try this

From
http://www.rondebruin.nl/delete.htm


Example with the criteria on a different sheet

The example below filter A1:A? In a sheet named "Sheet1"
Note: A1 is the header cell

And use as criteria all the cells in column A In a sheet named "Criteria".
Note:You can use also wildcards like *food* or *store if you want



Sub Delete_with_Autofilter_More_Criteria()
Dim rng As Range
Dim cell As Range
Dim Criteriarng As Range
Dim CalcMode As Long

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With Sheets("Criteria")
Set Criteriarng = .Range("A1", .Cells(Rows.Count, "A").End(xlUp))
End With

For Each cell In Criteriarng

With Sheets("Sheet1")
.Range("A1", .Cells(Rows.Count, "A").End(xlUp)) _
.AutoFilter Field:=1, Criteria1:=cell.Value

With .AutoFilter.Range
Set rng = Nothing
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete
End With

.AutoFilterMode = False
End With

Next cell

With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub




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



"Flip" wrote in message ...
I have an ~30,000 row master list, which contains 3,000 (noncontiguous) rows
of false information. I have compiled a list of the false data on a separate
worksheet. How do I efficiently match the two lists and delete the
corresponding false information from the master?



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
Inputting data to one worksheet for it effect another daedalus1 Excel Discussion (Misc queries) 1 June 25th 06 04:39 PM
resetting last cell jagdish.eashwar Excel Discussion (Misc queries) 11 March 31st 06 02:06 AM
Deleting Rows Automatically using a Text File List mirdonamy Excel Discussion (Misc queries) 9 January 11th 06 11:11 PM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM


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