
Option Explicit
Function Cont_Sei(B_AC As Range) As Long
Application.Volatile
Dim Bac As Variant
Dim Sei, uno, Ciclo As Long
For Each Bac In B_AC
Ciclo = Ciclo + 1
If Bac = 1 Then uno = uno + 1
If Ciclo = 7 Then
If uno = 6 Then
Sei = Sei + 1
End If
uno = 0
Ciclo = 0
End If
Next
Cont_Sei = Sei
End Function
|
AE2=(CONTA.SE(B2:H2;1)=6)*1+(CONTA.SE(I2:O2;1)=6)*1+(CONTA.SE(P2:V2;1)=6)*1+(CONTA.SE(W2:AC2;1)=6)*1 |
Function Cont_Sei(B_AC As Range) As Long
Application.Volatile
Dim Bac As Variant
Dim Sei, uno, Ciclo As Long
For Each Bac In B_AC
Ciclo = Ciclo + 1
If Bac = 1 Then uno = uno + 1
If Bac = "1+" Then uno = uno + 1
If Bac = "1*" Then uno = uno + 1
If Bac = "1**" Then uno = uno + 1
If Bac = 2 Then uno = uno + 1
If Bac = "2+" Then uno = uno + 1
If Bac = "2*" Then uno = uno + 1
If Bac = "2**" Then uno = uno + 1
If Bac = 3 Then uno = uno + 1
If Bac = "3+" Then uno = uno + 1
If Bac = "3*" Then uno = uno + 1
If Bac = "3**" Then uno = uno + 1
If Bac = "C" Then uno = uno + 1
If Bac = "C*" Then uno = uno + 1
If Bac = "C**" Then uno = uno + 1
If Bac = "C+" Then uno = uno + 1
If Bac = "F" Then uno = uno + 1
If Bac = "DISP" Then uno = uno + 1
If Bac = "DS" Then uno = uno + 1
If Ciclo = 7 Then
If uno = 6 Then
Sei = Sei + 1
End If
uno = 0
Ciclo = 0
End If
Next
Cont_Sei = Sei
End Function
|
Option Explicit
Function Cont_Sei(B_AC As Range) As Long
Application.Volatile
Dim Bac As Variant
Dim Sei, uno, Ciclo As Long
For Each Bac In B_AC
Ciclo = Ciclo + 1
If Bac Diverso "RC" And Bac Diverso "RO" And Bac Diverso "RFI" And Bac Diverso "M" Then uno = uno + 1
If Ciclo = 7 Then
If uno = 6 Then
Sei = Sei + 1
End If
uno = 0
Ciclo = 0
End If
Next
Cont_Sei = Sei
End Function
|
