| 
    
     |  | こんばんは。 
 
 >Type で作製した型ではOnTimeメソッドの引数にならないのでしょうか?
 
 変数は無理だと思いますよ!!
 特にローカル変数って、スタック領域に作成されるはずですから、
 Ontimeメソッドで指定されたプロシジャーを実行するときには、
 すでにメモリ上にはないですからね!!
 
 Application.OnTime Now + TimeValue("00:00:3"), _
 "'TestOnTime" & """" & i & """,""" & A & """'"
 ↑これが作動しているのは、あくまでも定数を引数にしているに過ぎません。
 
 
 一例です。
 
 新規ブックにて確認してください。
 
 
 標準モジュールに
 '===============================================================
 Option Explicit
 Public Type 足し算
 a As Long
 b As Long
 End Type
 '==============================================================
 Sub testtest(p As 足し算)
 MsgBox p.a + p.b
 End Sub
 
 
 上記のtesttestを連続して繰り返し実行させる事を考えます。
 
 
 Thisworkbookのモジュールに
 '======================================
 Option Explicit
 '=======================================================================
 Event timejust(ByVal cnt As Long, cancel As Boolean, t_para As Variant)
 '↑ イベント定義
 Private t_int As Date 'インターバル
 Private t_prm() As Variant 'パラメータ
 Private t_pcnt As Long 'パラメータの個数
 Private t_cnt As Long '連続処理回数
 Sub timer_set(interval As Date, ParamArray para() As Variant)
 'タイマーをセットする
 'interval 連続処理を行う間隔
 'para() データ渡しのためのパラメータ
 Dim g0 As Long
 Erase t_prm()
 t_int = interval
 t_pcnt = UBound(para()) + 1
 For g0 = LBound(para()) To UBound(para())
 ReDim Preserve t_prm(g0)
 t_prm(g0) = para(g0)
 Next
 Application.OnTime Now() + t_int, "thisworkbook.timer_exe"
 t_cnt = 0
 End Sub
 '===================================
 Sub timer_exe()
 '呼び出しプロシジャー
 Dim cancel As Boolean
 If t_pcnt = 0 Then
 RaiseEvent timejust(t_cnt + 1, cancel, False)
 Else
 RaiseEvent timejust(t_cnt + 1, cancel, t_prm())
 End If
 t_cnt = t_cnt + 1
 If cancel = False Then
 Application.OnTime Now() + t_int, "thisworkbook.timer_exe"
 End If
 End Sub
 
 
 更にSheet1のモジュールに
 '==============================================================
 Option Explicit
 Dim WithEvents bk As ThisWorkbook
 '===============================================================
 Sub main()
 Set bk = ThisWorkbook
 bk.timer_set TimeValue("00:00:3")
 End Sub
 '=======================================================================
 Private Sub bk_timejust(ByVal cnt As Long, cancel As Boolean, t_para As Variant)
 'cnt 処理の繰り返し回数
 'cancel trueを指定すると処理終了
 't_para データ引渡し変数
 このイベント内で呼び出したいプロシジャーにデータを渡します
 Dim a As 足し算
 a.a = cnt
 a.b = cnt
 Call testtest(a)
 If cnt >= 3 Then cancel = True '3回処理したら終了
 End Sub
 
 
 コードは長くなりましたが、再利用可能な形にはなりました。
 
 尚、Sheet1のモジュールの代わりにクラスモジュールを使用して
 工夫すればよいかもしれませんね。
 
 一例ですから、試してみてください
 
 |  |