Hello forum!
I'm new to excel and hope you guys could help.
Currently I'm using Zoho sheets (sorry for post in Excel forum, but community in Zoho not such big as here and things are pretty same) and I need to update this simple script to make it search and always highlight all sheets in document. It's hard to every time change macro when I add extra sheet.
I'm new to excel and hope you guys could help.
Currently I'm using Zoho sheets (sorry for post in Excel forum, but community in Zoho not such big as here and things are pretty same) and I need to update this simple script to make it search and always highlight all sheets in document. It's hard to every time change macro when I add extra sheet.
Code:
Sub highlightDups()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim maxOne As Long
Dim maxTwo As Long
Set ws1 = Sheets("One") 'change me
Set ws2 = Sheets("Two") 'change me
maxOne = ws1.Cells(Rows.count, "A").End(xlUp).Row
maxTwo = ws2.Cells(Rows.count, "A").End(xlUp).Row
For x = 2 To maxOne Step 1
For y = 2 To maxTwo Step 1
If ws1.Cells(x, 1) = ws2.Cells(y, 1) Then
ws1.Cells(x, 1).Interior.ColorIndex = 3
ws2.Cells(y, 1).Interior.ColorIndex = 3
GoTo Skip
End If
Next y
Skip:
Next x
End Sub