I have two ranges that should be identical (albeit they may be sorted differently). I'm trying to find any values in rangeA that are not in rangeB.
I'm able to find examples that show if values ARE matched in a range, but struggling to find anything if they aren't.
So far I have:
Sub Compare2()
Dim test1, cell As Range
Dim FoundRange As Range
Set test1 = Sheets("Names").Range("A1:A5")
For Each cell In test1
Set FoundRange = Sheets("Queue & Status").Range("A1:A200").Find(what:=test1, LookIn:=xlFormulas, lookat:=xlWhole)
If FoundRange Is Nothing Then
MsgBox (cell & " not found")
End If
Next cell
End Sub
But it's showing all values as being not matched, when they are.
Dim test1, cell As Rangeis declaringcellas aRange, andtest1as an implicitVariant.LookInformulas, or are you trying to compare values? (It won't matter which you do if all the cells are constants, but could cause problems if any of the data is calculated.)