Excel: Count textbox values greater than 0


Hi, I wonder to count textbox values greater than 0 and I made this code but it's not working. Could someone help me please? Thanks

Dim i As Integer
Dim divisor As Integer
divisor = 0
    
    For i = 1 To 11
        If ("TextBox" & i).Value > 0 Then
            divisor = dividor + 1
        End If
    Next i
Dim soma As Long
    
    soma = TextBox1.Value + TextBox2.Value + TextBox3.Value + TextBox4.Value + TextBox5.Value + TextBox6.Value + TextBox7.Value + TextBox8.Value + TextBox9.Value + TextBox10.Value + TextBox11.Value
    
    Label203.Caption = soma \ divisor


This question generated 21 answers. To proceed to the answers, click here.

This thread is current as of December 18, 2013.


For more resources for Microsoft Excel