Guest User

Untitled

a guest
Jul 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Public Function maxsuche(zahl As Double, feld_sT As Range) As Double
  2.  
  3. Dim i, j As Integer
  4. Dim a, b, c As Double
  5. Dim bereich As Range
  6.  
  7. '=maxsuche(AP6-5;AP8:AP368)
  8.  
  9. Set bereich = feld_sT
  10.  
  11. b = zahl
  12.  
  13. c = 1
  14.  
  15. For i = 1 To bereich.Rows.Count
  16.  
  17. If c = 1 Then
  18.  
  19. a = bereich(i, 2).Value
  20.  
  21. bereich(i, 2).Cells.Select
  22.  
  23. If a > b Then
  24.  
  25. c = bereich(i, 1).Value
  26.  
  27. c = Round(c, 0)
  28.  
  29. End If
  30.  
  31. End If
  32.  
  33. Next i
  34.  
  35. maxsuche = c
  36.  
  37. End Function
Add Comment
Please, Sign In to add comment