Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlight Duplicate Rows (In Series)

I'm looking for a way to highlight duplicate rows that cover a series of
cells. For example, each row in A1:A5 must match each row in A55:E55 to be
considered a duplicate.

What's the best way to go about this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Highlight Duplicate Rows (In Series)

probably add a column which concatenates the data from the used cells in a
row - depends on how many columns you have
you could then use the countif() formula to highlight where the duplicates
are ( countif 1)



"Rugby Stud" wrote in message
...
I'm looking for a way to highlight duplicate rows that cover a series of
cells. For example, each row in A1:A5 must match each row in A55:E55 to
be
considered a duplicate.

What's the best way to go about this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlight Duplicate Rows (In Series)

Hi Patrick,

Sounds promising... how do I do it? :-)
If I want to concat the data in range ?1:?5 and then use countif()?

"Patrick Molloy" wrote:

probably add a column which concatenates the data from the used cells in a
row - depends on how many columns you have
you could then use the countif() formula to highlight where the duplicates
are ( countif 1)



"Rugby Stud" wrote in message
...
I'm looking for a way to highlight duplicate rows that cover a series of
cells. For example, each row in A1:A5 must match each row in A55:E55 to
be
considered a duplicate.

What's the best way to go about this?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Highlight Duplicate Rows (In Series)

Option Explicit
Sub GetDuplicates()
Dim text As String
Dim cols As Long
Dim index As Long
Dim lastrow As Long
cols = 10 ' number of columns to check
lastrow = Range("A1").End(xlDown).Row
'add a column to get unique contants for say 10 columns
Columns(1).Insert
'built the text contetns
For index = 1 To cols
text = text & "& RC" & index + 1
Next
'then place in column 1
With Range("A1")
.FormulaR1C1 = "=" & Mid(text, 2)
.AutoFill Destination:=Range(Range("A1"), Cells(lastrow, "A"))
End With

' now add another column for the counter
Columns(1).Insert
With Range("A1")
.Formula = "=COUNTIF(B1:B" & lastrow & ",B1)"
.AutoFill Destination:=Range(Range("A1"), Cells(lastrow, "A"))
End With
'clean up
With Range(Range("A1"), Cells(lastrow, "A"))
.Calculate
.Value = .Value
End With
Columns(2).Delete

End Sub


"Rugby Stud" wrote in message
...
Hi Patrick,

Sounds promising... how do I do it? :-)
If I want to concat the data in range ?1:?5 and then use countif()?

"Patrick Molloy" wrote:

probably add a column which concatenates the data from the used cells in
a
row - depends on how many columns you have
you could then use the countif() formula to highlight where the
duplicates
are ( countif 1)



"Rugby Stud" wrote in message
...
I'm looking for a way to highlight duplicate rows that cover a series
of
cells. For example, each row in A1:A5 must match each row in A55:E55
to
be
considered a duplicate.

What's the best way to go about this?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlight Duplicate Rows (In Series)

Thank you, Patrick! I appreciate your help.

"Patrick Molloy" wrote:

Option Explicit
Sub GetDuplicates()
Dim text As String
Dim cols As Long
Dim index As Long
Dim lastrow As Long
cols = 10 ' number of columns to check
lastrow = Range("A1").End(xlDown).Row
'add a column to get unique contants for say 10 columns
Columns(1).Insert
'built the text contetns
For index = 1 To cols
text = text & "& RC" & index + 1
Next
'then place in column 1
With Range("A1")
.FormulaR1C1 = "=" & Mid(text, 2)
.AutoFill Destination:=Range(Range("A1"), Cells(lastrow, "A"))
End With

' now add another column for the counter
Columns(1).Insert
With Range("A1")
.Formula = "=COUNTIF(B1:B" & lastrow & ",B1)"
.AutoFill Destination:=Range(Range("A1"), Cells(lastrow, "A"))
End With
'clean up
With Range(Range("A1"), Cells(lastrow, "A"))
.Calculate
.Value = .Value
End With
Columns(2).Delete

End Sub


"Rugby Stud" wrote in message
...
Hi Patrick,

Sounds promising... how do I do it? :-)
If I want to concat the data in range ?1:?5 and then use countif()?

"Patrick Molloy" wrote:

probably add a column which concatenates the data from the used cells in
a
row - depends on how many columns you have
you could then use the countif() formula to highlight where the
duplicates
are ( countif 1)



"Rugby Stud" wrote in message
...
I'm looking for a way to highlight duplicate rows that cover a series
of
cells. For example, each row in A1:A5 must match each row in A55:E55
to
be
considered a duplicate.

What's the best way to go about this?


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
highlight duplicate rows James Excel Discussion (Misc queries) 4 October 10th 08 02:43 PM
highlight duplicate rows comparing two cells [email protected] Excel Programming 1 March 16th 08 12:41 PM
highlight duplicate rows comparing two cells [email protected] Excel Programming 3 March 13th 08 02:30 PM
How to Highlight Two Rows With Two Columns of Duplicate Values JSteph Excel Worksheet Functions 1 December 12th 07 01:59 AM
Highlight/remove duplicate rows Blasting Cap Excel Programming 3 September 7th 07 04:52 PM


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