Yu're right, i've not putted the question well. The table that it starts in
B11:K40 we fill with data, but then with VB it grabbs that values and uses it
to other things u can see in the program that i send.
What i want is to use the values in table B11:K40 and count with a
=countif(B11:K40;">"&B42) the numbers that are bigger than B42.
this formula works in a table alone but in the sheet i have that uses this
program below does not appear the value, so i guess is because of VB.
Is it?
The program:
Sub Frequência_1()
'
'
Application.ScreenUpdating = False
For i = 1 To 199
Valor(i) = 0
Next i
Range("B11").Select
K = 1
For i = 1 To 10
For j = 1 To 30
If ActiveCell.Value <> "" Then
Valor(K) = ActiveCell.Value
K = K + 1
End If
ActiveCell.Offset(1, 0).Select
Next j
ActiveCell.Offset(-30, 1).Select
Next i
Range("I72").Select
For i = 1 To 15
Cont = 0
Min = Selection
ActiveCell.Offset(0, 2).Select
Max = Selection
For j = 1 To K
If (Valor(j) >= Min) And (Valor(j) < Max) Then Cont = Cont + 1
Next j
ActiveCell.Offset(0, -6).Select
ActiveCell.Value = Cont
ActiveCell.Offset(1, 4).Select
Next i
Cr_1 = 0
Cr_2 = 0
Cr_3 = 0
Range("F42").Select
Média = ActiveCell.Value
Range("F46").Select
Desv = ActiveCell.Value
For i = 1 To K
If Valor(i) > (Média - Desv) And Valor(i) < (Média + Desv) Then Cr_1 =
Cr_1 + 1
If Valor(i) > (Média - 2 * Desv) And Valor(i) < (Média + 2 * Desv) Then
Cr_2 = Cr_2 + 1
If Valor(i) > (Média - 3 * Desv) And Valor(i) < (Média + 3 * Desv) Then
Cr_3 = Cr_3 + 1
Next i
Range("D90").Select
ActiveCell.Value = Cr_1
Range("D91").Select
ActiveCell.Value = Cr_2
Range("D92").Select
ActiveCell.Value = Cr_3
For i = 1 To 199
Valor(i) = 0
Next i
Range("M11").Select
K = 1
For j = 1 To 30
If ActiveCell.Value <> "" Then
Valor(K) = ActiveCell.Value
K = K + 1
End If
ActiveCell.Offset(1, 0).Select
Next j
Range("P72").Select
For i = 1 To 15
Cont = 0
Min = Selection
ActiveCell.Offset(0, 1).Select
Max = Selection
For j = 1 To K
If (Valor(j) >= Min) And (Valor(j) < Max) Then Cont = Cont + 1
Next j
ActiveCell.Offset(0, -3).Select
ActiveCell.Value = Cont
ActiveCell.Offset(1, 2).Select
Next i
Cr_1 = 0
Cr_2 = 0
Cr_3 = 0
Range("J42").Select
Média = ActiveCell.Value
Range("J46").Select
Desv = ActiveCell.Value
For i = 1 To K
If Valor(i) > (Média - Desv) And Valor(i) < (Média + Desv) Then Cr_1 =
Cr_1 + 1
If Valor(i) > (Média - 2 * Desv) And Valor(i) < (Média + 2 * Desv) Then
Cr_2 = Cr_2 + 1
If Valor(i) > (Média - 3 * Desv) And Valor(i) < (Média + 3 * Desv) Then
Cr_3 = Cr_3 + 1
Next i
Range("J90").Select
ActiveCell.Value = Cr_1
Range("J91").Select
ActiveCell.Value = Cr_2
Range("J92").Select
ActiveCell.Value = Cr_3
End Sub