I'm running into a unique situation dealing with duplicates.
I have the following sheets:
Sheet1:
Sheet2:
Sheet3:
My current macro included in the workbook will compare any two columns within individual sheets and delete them.
For example in sheet1, C-3 and C-3 occurs twice, so the macro will get rid of one occurrence of C-3. Same with Sheet2 and Sheet3.
What I would like additionally, is for the macro to compare say A-1 with A-2, then make both cells color as red text. For example, all cells in Sheet 1 other than C-3 would be red. Again for example in Sheet3 after the duplicate deletion happens, all cells other than A-1 would be highlighted red.
Once all the red cells are highlighted, I'd like to create a new sheet say "Duplicated List" then create links to all sheets that contain duplicates. For example consider a Sheet4 and Sheet5 where duplicates don't exist at all. The links should only be created for Sheet1, Sheet2 and Sheet3.
Please advise me in how to achieve this. Thank you.
I have the following sheets:
Sheet1:
Sheet2:
Sheet3:
My current macro included in the workbook will compare any two columns within individual sheets and delete them.
VBA Code:
Sub delete()
Dim x As Range
Dim lstrw As Long
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
lstrw = sh.Range("A" & Rows.Count).End(xlUp).Row
Set x = sh.Range("A1:B10000" & lstrw)
x.RemoveDuplicates Columns:=Array(1, 2), Header:=xlNo
Next sh
End Sub
For example in sheet1, C-3 and C-3 occurs twice, so the macro will get rid of one occurrence of C-3. Same with Sheet2 and Sheet3.
What I would like additionally, is for the macro to compare say A-1 with A-2, then make both cells color as red text. For example, all cells in Sheet 1 other than C-3 would be red. Again for example in Sheet3 after the duplicate deletion happens, all cells other than A-1 would be highlighted red.
Once all the red cells are highlighted, I'd like to create a new sheet say "Duplicated List" then create links to all sheets that contain duplicates. For example consider a Sheet4 and Sheet5 where duplicates don't exist at all. The links should only be created for Sheet1, Sheet2 and Sheet3.
Please advise me in how to achieve this. Thank you.