ソースコード

 
 こんなん。Excel でタイマー処理する方法については,SHOJI's Code さん(http://shoji.blog1.fc2.com/blog-entry-29.html)を参考にしました。
 
 Excel の標準モジュール内

Public Declare Function SetTimer Lib "USER32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "USER32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Dim CountA As Long
Dim CountB As Long

'250ミリ秒単位の検索
Public Sub TimerProc1()
On Error Resume Next
Dim num As Integer

num = Rnd * 100

If Sheet1.Range("A1") = Right("00" & CStr(num), 2) Then
Sheet1.Range("B1") = Sheet1.Range("B1") + 1
Sheet1.Range("A1") = Right("00" & CStr(Rnd * 10000), 2)
End If
If Sheet1.Range("A2") = Right("00" & CStr(num), 2) Then
Sheet1.Range("B2") = Sheet1.Range("B2") + 1
Sheet1.Range("A2") = Right("00" & CStr(Rnd * 100), 2)
End If

End Sub

'10s単位の変更
Public Sub TimerProc2()
On Error Resume Next

Sheet1.Range("A2") = Right("00" & CStr(Rnd * 100), 2)
Sheet1.Range("A3") = Sheet1.Range("A3") + 1

End Sub

 
 Excel ワークシート内

Private Sub CommandButton1_Click()
SetTimer 0&, 31000&, 250&, AddressOf TimerProc1
SetTimer 0&, 31000&, 10000, AddressOf TimerProc2

End Sub