Dim n
Dim nn
Dim b
Dim stat As Single
Dim total As Single
Dim value As Single



Private Sub CommandButton1_Click()
cekdata
prosen_hi_lo
 Label1.Caption = " range procentage over " & value & " pip per day"
 Label3.Caption = "  range more than " & value & " pip per day"
 Label8.Caption = "  range less than " & value & " pip per day"

End Sub



'this came from chivas88chi
'copyright 25889881977
'cek the expectation of minimum daily range for ###.## digit format in percent
'use directly on Usd-Jpy GbpJpy UsdChf
'open the excel file, enabled the macros, pres "ctrl+m" to run



Sub prosen_hi_lo()

total = 0
stat = 0
value = TextBox5.value


For cek = nn To n
    total = total + 1
    data = Cells(cek, 9).value
    If data > value Then stat = stat + 1

Next

TextBox3 = total
TextBox4 = stat

prosen = (stat / total) * 100

TextBox6.value = prosen & "  %"
TextBox7.value = (total - stat)

End Sub



Sub cekdata()
n = 0
nn = 0
b = 0

        For cek = 1 To 5000
                x = Cells(cek, 1).value
                If x <> "" Then n = n + 1
                If x = "" Then Exit For
        
        Next
 
'menandai awal baris

      For cek = 1 To 50
                xx = Cells(cek, 1).value
                If xx <> "" Then nn = nn + 1
                If xx = "1" Then Exit For
      Next
    
        totalbaris = n
        databegin = nn
 
        TextBox1.Text = n
        TextBox2.Text = nn

    
 ' For cek2 = nn To n
            '    Cells(cek2, 19).Value = "cekakaan"
 '  Next
    
        
        
        
End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub CommandButton3_Click()
TextBox5.value = 100
End Sub

Private Sub UserForm_Click()

End Sub
