Created
June 22, 2017 17:16
-
-
Save ndthanh/d37b2214fde92d219b9cf34ed676ff0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub CompareRanges() | |
'Update 20130815 | |
Dim WorkRng1 As Range, WorkRng2 As Range, Rng1 As Range, Rng2 As Range | |
xTitleId = "Hoc Excel Online" | |
Set WorkRng1 = Application.InputBox("Range A:", xTitleId, "", Type:=8) | |
Set WorkRng2 = Application.InputBox("Range B:", xTitleId, Type:=8) | |
For Each Rng1 In WorkRng1 | |
rng1Value = Rng1.Value | |
For Each Rng2 In WorkRng2 | |
If rng1Value = Rng2.Value Then | |
Rng1.Interior.Color = VBA.RGB(255, 0, 0) | |
Exit For | |
End If | |
Next | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment