ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a way to compare all columns in a Row and flag difference (https://www.excelbanter.com/excel-programming/392594-there-way-compare-all-columns-row-flag-difference.html)

Neil

Is there a way to compare all columns in a Row and flag difference
 
I would like to compare that the values for each column of two different rows
are identical. If there are differences on the second row flag them somehow.

Is this possible?

Tom Ogilvy

Is there a way to compare all columns in a Row and flag difference
 
To compare the value in cells in rows 2 and 5

Dim rng as Range, cell as Range
Range("2:2,5:5").Interior.ColorIndex = xlNone
set rng = Range(Cells(2,1),Cells(2,columns.Count).End(xltoLe ft))
for each cell in rng
if cell < cell.offset(3,0) then
cell.Interior.ColorIndex = 3
cell.offset(3,0).Interior.Colorindex = 3
end if
Next

Assumes column 2 has values farthest to the right or they are equal.

--
Regards,
Tom Ogilvy

"Neil" wrote:

I would like to compare that the values for each column of two different rows
are identical. If there are differences on the second row flag them somehow.

Is this possible?



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com