Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can Anyone Solve This One, Please, From Liz

How can I use excel to find consecutive duplicate entries in a column?


e.g,
Col B
1614
1522
1522 duplicate consecutive entry
how can I use excel to flag this for me?

Thanks,

Liz Merrill

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Can Anyone Solve This One, Please, From Liz

Hi
see:
http://www.cpearson.com/excel/duplic...gingDuplicates

--
Regards
Frank Kabel
Frankfurt, Germany

"Lizmerrill" schrieb im Newsbeitrag
...
How can I use excel to find consecutive duplicate entries in a

column?


e.g,
Col B
1614
1522
1522 duplicate consecutive entry
how can I use excel to flag this for me?

Thanks,

Liz Merrill


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Can Anyone Solve This One, Please, From Liz

Here is how I did that:

Sub RemoveDuplicates()

Dim totalrows As Integer
Dim nameColumn As Integer
Dim count As Integer
Dim Row As Integer

totalrows = ActiveSheet.UsedRange.Rows.count
count = 0
nameColumn = 1
For Row = totalrows To 6 Step -1

' I had some empty names that did not need to be deleted
If Cells(Row, nameColumn).Value < Empty Then

If Cells(Row, nameColumn).Value = Cells(Row - 1, nameColumn).Value
Then
Rows(Row).Delete
count = count + 1
End If
End If
Next Row
If ShowMsgs Then
MsgBox "Rows deleted equals " & count
End If

Probably not as elegant as it could have been, but hopefully it is
understanable and helps.

Ken Loomis


"Lizmerrill" wrote in message
...
How can I use excel to find consecutive duplicate entries in a column?


e.g,
Col B
1614
1522
1522 duplicate consecutive entry
how can I use excel to flag this for me?

Thanks,

Liz Merrill



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default OOPS Can Anyone Solve This One, Please, From Liz

I gave you code to delete the duplicates before I realized you just wanted
to flag them.

Sorry.

Ken Loomis


"Ken Loomis" wrote in message
...
Here is how I did that:

Sub RemoveDuplicates()

Dim totalrows As Integer
Dim nameColumn As Integer
Dim count As Integer
Dim Row As Integer

totalrows = ActiveSheet.UsedRange.Rows.count
count = 0
nameColumn = 1
For Row = totalrows To 6 Step -1

' I had some empty names that did not need to be deleted
If Cells(Row, nameColumn).Value < Empty Then

If Cells(Row, nameColumn).Value = Cells(Row - 1, nameColumn).Value
Then
Rows(Row).Delete
count = count + 1
End If
End If
Next Row
If ShowMsgs Then
MsgBox "Rows deleted equals " & count
End If

Probably not as elegant as it could have been, but hopefully it is
understanable and helps.

Ken Loomis


"Lizmerrill" wrote in message
...
How can I use excel to find consecutive duplicate entries in a column?


e.g,
Col B
1614
1522
1522 duplicate consecutive entry
how can I use excel to flag this for me?

Thanks,

Liz Merrill





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Can Anyone Solve This One, Please, From Liz

To simply flag the 2nd one, use conditional formatting: select the cells in
column B, with B2 active, Format/Conditional Formatting, Formula Is, and type
=B1; then set your formatting.

On 06 Oct 2004 19:25:39 GMT, (Lizmerrill) wrote:

How can I use excel to find consecutive duplicate entries in a column?


e.g,
Col B
1614
1522
1522 duplicate consecutive entry
how can I use excel to flag this for me?

Thanks,

Liz Merrill




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
Solve for X and Y Mark M Excel Worksheet Functions 9 September 28th 09 01:07 PM
Need help to solve err#429 March Excel Discussion (Misc queries) 0 January 17th 08 07:21 PM
if A1<0 let B2 =A1 and if A1=0 let B3=A1 solve PLEASE!!!!!!!!!! techwiz101 Excel Worksheet Functions 2 December 7th 07 02:26 AM
y i cannot solve it ? cjjoo Excel Worksheet Functions 2 September 26th 05 11:37 AM
How do I solve this? Metallo[_3_] Excel Programming 14 July 12th 04 10:01 PM


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