Now you can look at the macros in which alt2005 described special functions. You can't do without Visual Basic programming skills. But if we want to get the necessary functions for Excel, we'll have to figure it out
Public Function getResult(z As Range, distance As Long, repeats As Long, Optional w = 0) As Variant
Dim i As Long
Dim bottomAddresses as long
Dim for As Long
Dim counter as long
Dim sum as long
Dim umsatz As Long
Dim num As Long
Dim ss As String
Dim d As Long
bottomAdres = z.Row - distance + 1
If bottomAddress < 1 Then
getResult = 0
Exit Function
End If
counter = 1
d = 0
For i = z.Row - 1 To bottomAdres Step -1
d = d + 1
za = Worksheets(z.Worksheet.Name).Cells(i, 1)
If z = z.Value Then
counter = counter + 1
End If
If counter = repeats Then
Exit For
End If
Next i
If counter < repeats Then
getResult = 0
Exit Function
End If
For i = z.Row + 1 To z.Row + distance
umsatz = umsatz + 1
za = Worksheets(z.Worksheet.Name).Cells(i, 1)
If z = z.Value Then
sum = sum + 35
If w = 0 Then
getResult = sum
End If
If w = 1 Then
getResult = umsatz
End If
If w = 2 Then
getResult = i
End If
Exit Function
Else
sum = sum - 1
End If
Next i
getResult = sum
If w = 1 Then
getResult = umsatz
End If
End Function
Public Function getNextZ(z As Range, za As Long, Optional w = 0) As Variant
Dim bottom as long
Dim i As Long
Dim valuation as option
Dim cou as long
Dim startVal As Long
Dim zc As Long
startVal = z.Value
For i = z.Row + 1 To z.Row + 600
cou = cou + 1
zc = Worksheets(z.Worksheet.Name).Cells(i, z.Column)
If zc = za Then
If w = 0 Then
getNextZ = cou
End If
If w = 1 Then
getNextZ = i
End If
Exit Function
End If
Next i
getNextZ = 0
End Function
Public Function getPredZ(z As Range, za As Long, Optional w = 0) As Variant
Dim bottom as long
Dim i As Long
Dim valuation as option
Dim cou as long
Dim startVal As Long
Dim zc As Long
startVal = z.Value
bottom = z.Row - 600
If bottom < 1 Then
bottom = 1
End If
For i = z.Row - 1 To bottom Step -1
cou = cou + 1
zc = Worksheets(z.Worksheet.Name).Cells(i, z.Column)
If zc = startVal Then
If w = 0 Then
getPredZ = cou
End If
If w = 1 Then
getPredZ = i
End If
Exit Function
End If
Next i
getPredZ = 0
End Function
{\__/} ( • - •) Let me wish /つ ✿ you good luck!
Please Log in to join the conversation.