Jeremiah32
Programmer
I found an array function that returns a true and false column values in a row are zero for mimumn of three consecutive times. Function works fine,, I was wondering cna the function be modified to identify consecutive values of zero or one? I'm working with a query that is linked with txt file.
thanks
Need to return a true value if consective values are 1,0,1 fales for 1,20,1
Public Function getConsecutive(ParamArray varValues() As Variant) As Boolean
Const intConsecutive = 3
Const intAmount = 0
Dim varVal As Variant
Dim intCount As Integer
For Each varVal In varValues
If Nz(varVal, 0) = 0 Then
intCount = intCount + 1
Else
intCount = 0
End If
If intCount = 3 Then Exit For
Next varVal
If intCount >= 3 Then getConsecutive = True
End Function
thanks
Need to return a true value if consective values are 1,0,1 fales for 1,20,1
Public Function getConsecutive(ParamArray varValues() As Variant) As Boolean
Const intConsecutive = 3
Const intAmount = 0
Dim varVal As Variant
Dim intCount As Integer
For Each varVal In varValues
If Nz(varVal, 0) = 0 Then
intCount = intCount + 1
Else
intCount = 0
End If
If intCount = 3 Then Exit For
Next varVal
If intCount >= 3 Then getConsecutive = True
End Function