zeuslorenzo
New Member
- Joined
- Jun 3, 2013
- Messages
- 24
Hi All
I need to search the value in sheet2 and look for the value in sheet1
if the value exist anywhere in the sheet then the value in the sheet2 should be highlighted.
I have code for this process however, it will only search for the values in a specific column not the entire sheet (used range). Please help me with the code. Also if there is a method to get this done via a formula please let me know.
Sub i77()
Dim Rng As Range
Dim loz As Range
Dim N As Integer
Dim cell As Range
Set Rng = Sheet2.UsedRange
N = 3
Application.ScreenUpdating = True
Do While Sheet2.Range("A" & N) <> ""
Set loz= Sheet1.Range("A" & N)
For Each cell In Rng
If cell.Value = loz Then cell.Interior.ColorIndex = 3
Next
N = N + 1
Loop
End Sub
Thanks in advance.
I need to search the value in sheet2 and look for the value in sheet1
if the value exist anywhere in the sheet then the value in the sheet2 should be highlighted.
I have code for this process however, it will only search for the values in a specific column not the entire sheet (used range). Please help me with the code. Also if there is a method to get this done via a formula please let me know.
Sub i77()
Dim Rng As Range
Dim loz As Range
Dim N As Integer
Dim cell As Range
Set Rng = Sheet2.UsedRange
N = 3
Application.ScreenUpdating = True
Do While Sheet2.Range("A" & N) <> ""
Set loz= Sheet1.Range("A" & N)
For Each cell In Rng
If cell.Value = loz Then cell.Interior.ColorIndex = 3
Next
N = N + 1
Loop
End Sub
Thanks in advance.