I am trying to loop across each cell in a range (IN ACTIVE TAB "Import Data") and match it with values from range in de-actvie Tab ("BU Names"), in case of a cell that holds a string that is not compliant with my selected range i would like to inform the user about an error
WHEN IT WORKS? When instead of few cells within a range I have only one.
ERRORS WHILE: Range is brighter.
working part
With Worksheets("BU Names")
LastBU = .Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("BU Names").Activate
.Range(.Cells(2, 1), .Cells(LastBU, 1)).Select
Worksheets("Import Data").Activate
End With
help below please
Myrange = Range("E5:G6")
For Each cel In Myrange
Set cel_checker = Selection.Find(What:=cel, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=True, SearchFormat:=False)
If cel_checker Is Nothing Then
MsgBox "Please correct " & cel2 & " as this is not valid Business Unit"
End If
Next
The problem seems to be at "Set cel_checker = Selection.Find" when it keeps under cel_cheker 'nothing' instead of values which is correct