Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function FilterOrSomethingLikeThat(surname as String, course as String)
- Dim iStartRow As Integer = 2
- Dim iStopRow As Integer = 65535
- Dim sStopCriteria As String = ""
- Dim sStopCriteriaField as String = "A"
- Dim sValueField As String
- Dim sSurnameField As String
- dim sCourseField As String
- iStartRow = 2 ' Where to start the search
- iStopRow = 65535 ' Where to stop the search
- sStopCriteria = "" ' When to stop if
- sStopCriteriaField = "A" ' this field equals sStopCriteria
- sSurnameField = "B" ' Where the surname is in
- sCourseField = "C" ' Where the course is in
- sValueField = "D" ' Where the value you want is in
- Dim i as Integer
- For i = iStartRow To iStopRow
- If Range(sStopCriteriaField&i).Value = sStopCriteria Then Exit For
- If Range(sSurnameField&i).Value = surname AND Range(sCourseField&i).Value = course Then
- FilterOrSomethingLikeThat = Range(sValueField&i).Value
- Exit Function
- End If
- Next
- FilterOrSomethingLikeThat = "Not Found :("
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement