View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RichardSchollar RichardSchollar is offline
external usenet poster
 
Posts: 196
Default Help with Filter and Delete...... Please

Les

Apply a second filter to column A for whatever number you wish to
delete and then delete them.

When I do something like this, I usually set two range objects - one
for the autofilter range, and one for the data range (ie the same less
header row), and then use SpecialCells method to delete only the
visible cells. In xl2002 and 2003 you don't have to worry about using
the SpecialMethod, but it does make your code absolutely clear what you
are doing (and intending to do). Something like:

With rng
.Autofilter Field:=1, Criteria1:=<Your Number Here
rng2.SpecialCells(xlCellTypeVisible).EntireRow.Del ete
End With

Does this give you enough detail to work up a solution?

Best regards

Richard


Les Stout wrote:

Hi all, i have many rows with the same number in column A and i am
filtering column F for the criteria "ZA-T-M-*" which is working fine.
However i need somehow to delete all rows with the same number in column
A. The second last row has ZA-T-M-* in it so all rows with instances of
"A15862" in column "A" muist be deleted. Can someone please help. Thank
you in advance...

A B C D E F
A15862 Creation K5210 7118410 UPHOLSTERY EI-
A15862 Creation K5210 7118410 UPHOLSTERY E-M
A15862 Creation K5210 7139700 UPHOLSTERY EI-A15862 Creation
K5210 7139700 UPHOLSTERY FZ-A15862 Creation
L2
A15862 Creation TI-
A15862 Creation ZA-T-M-1
A15862 Creation


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***