LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use autofilter to delete duplicate rows (2nd criteria) ?


I have this code already that deletes rows based on criteria "3/25/2005"
in column A.
And it works exellently.

1. Is there a way to add functionality to this autofilter code to
delete duplicate rows by checking column A for duplicate values and
deleting the row?

2. I would like to add a second criteria to delete row with
"12/31/2005" in column A. How do i make this happen?

Here is what i have: Any ideas will be mucho appreciated ;)


Code:
--------------------

Worksheets("MyTable").Select
With ActiveSheet
If .AutoFilterMode = False Then .Cells(1, 1).AutoFilter
.Range("A1").AutoFilter Field:=1, Criteria1:=#3/25/2005#
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
.AutoFilterMode = False
End With
--------------------


--
Mslady
------------------------------------------------------------------------
Mslady's Profile: http://www.excelforum.com/member.php...o&userid=27776
View this thread: http://www.excelforum.com/showthread...hreadid=480312

 
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
delete duplicate rows, keep one Wasdell Excel Discussion (Misc queries) 1 October 30th 09 12:16 PM
delete duplicate rows christinaLO Excel Worksheet Functions 1 February 27th 07 06:22 PM
delete rows autofilter masterphilch Excel Programming 3 January 5th 05 08:07 PM
HELP delete duplicate rows. Malcolm Excel Programming 2 September 29th 03 11:48 AM
Delete duplicate rows christina Excel Programming 1 August 4th 03 01:04 PM


All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"