Function Nadji_Vrijednost(ImeS As String, Rn As Range, Sifra As Integer) As Integer Dim Sit As Worksheet Dim Red As Range, RedB As Integer Dim CEL As Range, R As Range Dim a a = Rn.Address Set Sit = Worksheets(ImeS) Sit.Activate Set R = Sit.Range(a) For Each Red In R.Rows If Red = Sifra Then RedB = Red.Cells.Row Set CEL = Sit.Cells(RedB, 34) Nadji_Vrijednost = CEL.Cells End If 'jeli treba ovo Next Red' i jeli treba ovo End If