Function Trazi_Muju(Region As Range, Ime As String, Zanimanje As String) Dim I As Integer Dim Kolone(1) As Integer Dim Poredjenje(1) As String Kolone(0) = Region.End(xlUp).Column Kolone(1) = Region.End(xlUp).Column + 1 If Region.EntireColumn.Columns.Count <> 2 Then GoTo Kraj Poredjenje(0) = Ime & Zanimanje For I = 1 To Region.Rows.Count Poredjenje(1) = Region(I, Kolone(0)).Value & Region(I, Kolone(1)).Value If Poredjenje(0) = Poredjenje(1) Then MsgBox "Red: " & I & "Ispunjava kriterij" End If Next I Exit Function Kraj: MsgBox "Pogrešna selekcija" End Function