Hi there
I'm trying to make a seach function based on compare.
It' just does'nt work.
Is it because compare doesn't support multible variables.
If yes, what should I use insted?
This is what I've made
Sub Test()
Dim CompareRange As Variant, A As Variant, B As Variant, X As Variant, Y As Variant
Sheets("123").Select
Range("B2:Z2").Select and Range("A3:A10")
' ("B2:Z2") is selection A
' ("A3:A10") is selction X
Set CompareRange = Workbooks("ABC").Worksheets("456").Range("B3:B260") and Range("C3:C260")
' ("B3:B260") is CompareRange B
' ("C3:C260") is CompareRange Y
For Each A In Selection
For Each B In CompareRange
For Each X in selction
For Each Y in CompareRange
If A = B And B <> 0 And X = Y and Y <> 0 Then X.Offset(0, 1) = B.Offset(0, -1)
Next B
Next A
Next Y
Next X
End Sub
Thanks to aelgadi
Bookmarks