I have a spreadsheet with approx 300 rows. Each row has about 4 columns, and each cell contains a numeric value. Each row corresponds to a respondent.
I want to get Excel, for each respondent, to highlight cells if there are repeated values.
For example:
╔══════╦══════╦══════╦══════╗ ║ Col1 ║ Col2 ║ Col3 ║ Col4 ║ ╠══════╬══════╬══════╬══════╣ ║ 2 ║ 4 ║ 12 ║ 9 ║ ║ 2 ║ 5 ║ 23 ║ 5 ║ ╚══════╩══════╩══════╩══════╝
Here I want both 5 to be highlighted, but not the 2s because they are in different rows. However, I have 400 rows and it will take too long to select each row individually and set the Conditional Formatting. On the other hand, if I select the entire range and apply Conditional Formatting, Excel calculates the duplicates in the whole range, which isn’t useful. Another user suggested using the below Macro, but it isn’t working:
Sub NewCF()
Range("B1:P1").Copy
For Each r In Selection.Rows
r.PasteSpecial (xlPasteFormats)
Next r
Application.CutCopyMode = False
End Sub
I've tried the Macro above, but for some reason, when I run it, all it does is to underline the cells selected, even though the ones in my range are not underlined.
Any Ideas to do this in a efficient way?