Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Deleting rows by specified criteria for duplicates

It shouldn't, didn't in my tests.

Can you layout some sample data for me to test it with?

--
__________________________________
HTH

Bob

"Tasha" wrote in message
...
Thanks Bob. I tried it though, and it deleted everything except the
column headers???? Did I do something wrong?

"Bob Phillips" wrote:

Sub DeleteData()
Dim LastRow As Long
Dim rng As Range

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Columns("F").Insert
.Range("F2").Resize(LastRow - 1).Formula = _

"=SUMPRODUCT(--($A$2:$A2=A2),--($B$2:$B2=B2),--($E$2:$E2=E2))1"
.Range("F1").Value = "temp"
.Columns("F").AutoFilter field:=1, Criteria1:="TRUE"
Set rng = .Rows(2).Resize(LastRow -
1).SpecialCells(xlCellTypeVisible)
If Not rng Is Nothing Then rng.Delete
.Columns("F").Delete
End With
End Sub



--
__________________________________
HTH

Bob

"Tasha" wrote in message
...
I have gone through all of the posts looking for an answer to my
problem,
and
haven't been able to find one yet. Hoping someone can help me???

I have a spreadsheet that contains the following rows:
A-Date of Operation
B-Acct#
C-Type
D-Name
E-Doctor
F-Operation

I have many duplicates. I need to delete only 1 row of the duplicates
if
they match in columns A-B and E.

Can someone help me with this? This is a huge spreadsheet and is
taking
forever to do it manually. Thanks!!






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
Deleting Rows w/ Specific Criteria MCSHMCH Excel Discussion (Misc queries) 2 September 28th 07 01:05 PM
Deleting Duplicates Jane Excel Discussion (Misc queries) 3 August 17th 07 02:58 AM
Deleting duplicates katana Excel Discussion (Misc queries) 4 February 7th 06 06:33 PM
Deleting/IDing Rows that Don't Meet Criteria LittleAndLost Excel Worksheet Functions 1 November 3rd 04 07:21 PM
Deleting/IDing Rows that Don't Meet Criteria LittleAndLost Excel Worksheet Functions 2 November 3rd 04 01:32 PM


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

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"