Macro to compare "main row"

bb86993

New Member
Joined
May 21, 2013
Messages
23
Hello to All
Urgent help needed
1. Workbook (two sheets with numbers)
2. User manually selects range of cells (numbers in same row but different columns)
Example (main selection):
c d e f g h i j k l
1 2 3 4 5 6 7 8 9 10

3. Macro checks both sheets, compares "Main Selection" with other rows and highlights "doubles" (including "main selection")

Example rows (could be different length):
1) 2 5 7 15 27 56 47 74 85 1 10... (2,5,7,1,10 would be highlighted)
2) 1 3 8 4 22 33 55 90 10 6 7 9... (1,3,8,4,10,6,7,9 would be highlighted)

I found macro to compare ActiveCell but don't know how to modify it accordingly. Too far from programming
frown.gif

Sub HighlightCells()
ActiveSheet.UsedRange.Cells.FormatConditions.Delete
ActiveSheet.UsedRange.Cells.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=ActiveCell
ActiveSheet.UsedRange.Cells.FormatConditions(1).Interior.ColorIndex = 4

End Sub

Thank you in advance
Your help is very appreciated
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Sergio,

Long time no see :)
Have another "project" if you're willing to help
Data: a lot of rows but only 7 or 8 columns
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23

I'd like to choose and combine multiple rows into one row with initial data intact (something like "cut & paste")
1 2 3 4 5 6 7 8 17 18 19 20 21 22 23 (always maximum 21 cells in a row)

Thank you in advance

B.
 
Upvote 0

Forum statistics

Threads
1,216,753
Messages
6,132,514
Members
449,732
Latest member
Viva

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top