Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find rows with a common item and find or highlight difference

Is there a way to find rows that have a common item in say column A and then
find and list or highlight the differences between them (the rows)? There
could be different items on each row but there also can be the same item on
more than one row.

Hope this makes sense.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Find rows with a common item and find or highlight difference

You could probably do it using the Find method for a single item. I can't
visualize doing it for more than one, since the range of rows could overlap
and distort the results. Start with A2 as the first source cell. Search,
beginning in A3, through
the last row, move down one and continue the process until a match is found
or the range is exhausted.

Sub hilite()
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To lastRow
For Each c In Range("A" & i & ":A" & lastRow)
If c.Value = Range("A" & i - 1).Value Then
Rows(i - 1 & ":" & c.Row).Interior.ColorIndex = 5
Exit Sub
End If
Next
Next
End Sub


"jonnybrovo815" wrote:

Is there a way to find rows that have a common item in say column A and then
find and list or highlight the differences between them (the rows)? There
could be different items on each row but there also can be the same item on
more than one row.

Hope this makes sense.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Find rows with a common item and find or highlight difference

You probably noticed that I did not use the find method. But I still
terminated the search after the first match for the same reason stated.

"jonnybrovo815" wrote:

Is there a way to find rows that have a common item in say column A and then
find and list or highlight the differences between them (the rows)? There
could be different items on each row but there also can be the same item on
more than one row.

Hope this makes sense.

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
To find rate of each item from item.xls and to copy price.xls pol Excel Discussion (Misc queries) 7 July 16th 09 12:49 AM
From 2 rows or column how to find common numbers A S Matharu Excel Discussion (Misc queries) 1 March 13th 09 12:39 AM
How to find common strings of text then copy those rows elsewhere? energyzone Excel Worksheet Functions 6 April 20th 08 06:54 PM
How to find and highlight common text in multiple columns ToExcelAtExcel Excel Discussion (Misc queries) 2 November 13th 06 10:44 PM
Find item and delete rows Joseph[_28_] Excel Programming 1 April 20th 04 06:55 PM


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

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

About Us

"It's about Microsoft Excel"