Hi Guy's,
I have vba code for comparing value in two sheets in same workbook which compare data and highlights difference's with color in both the sheets however it has uppercase and lowercase issue so I would like to modify this code to resolve uppercase and lowercase issue. Extra space is another issue so need help for that too.
Code is as follows :
Any help would be much appreciated.
Thanks and regards,
Shuk
I have vba code for comparing value in two sheets in same workbook which compare data and highlights difference's with color in both the sheets however it has uppercase and lowercase issue so I would like to modify this code to resolve uppercase and lowercase issue. Extra space is another issue so need help for that too.
Code is as follows :
Code:
Public Sub CompareSheets()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim cell As Range, rng As Range
Set ws2 = Worksheets("XYZ")
Set ws3 = Worksheets("Abcdefg")
Set rng = ws2.Range("A2:A500")
For Each cell In rng
Celladdress = cell.Address
If cell <> ws3.Range(Celladdress) Then
cell.Interior.Color = vbRed
ws3.Range(Celladdress).Interior.Color = vbRed
End If
Next cell
Set rng = ws2.Range("B2:B500")
For Each cell In rng
Celladdress = cell.Address
If cell <> ws3.Range(Celladdress) Then
cell.Interior.Color = vbYellow
ws3.Range(Celladdress).Interior.Color = vbYellow
End If
Next cell
End Sub
Any help would be much appreciated.
Thanks and regards,
Shuk
Last edited by a moderator: