turtleKing
New Member
- Joined
- Oct 25, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
So I have one 'master sheet' and 'data sheet'. I need to find and highlight the names that are found in the data sheet that is not found in the master sheet.
Currently this is my code
The error is 'object does not support this property or method
Currently this is my code
VBA Code:
Sub Generate_Counts()
Dim Ws1 As Worksheet
Dim Ws1 As Worksheet
Dim Ws2 As Worksheet
Set Ws1 = Workbooks("Close_2022").Worksheets("Sheet 1")
Set Ws2 = Workbooks("User_ID").Worksheets("Sheet 2")
Dim LR1, LR2, LR3 As Integer
LR1 = Ws1.Cells(Ws1.Rows.Count, 3).End(xlUp).Row
LR2 = Ws2.Cells(Ws2.Rows.Count, 1).End(xlUp).Row
Dim Rng1 As Range
Dim Rng2 As Range
Set Rng1 = Ws1.Range("C2:C" & LR1)
Set Rng2 = Ws2.Range("A2:A" & LR2)
Dim x, y As Integer
Dim Find As Variant
For x = 1 To LR2
For y = 2 To LR1
If Ws2.Cells(x, 1).Values <> Ws1.Cells(y, 3).Values Then
Ws1.Cells(y, 3).Interior.Color = vbYellow
End If
Next y
Next x
End Sub
The error is 'object does not support this property or method