Results 1 to 4 of 4

Thread: [RESOLVED] run sub every x minutes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Resolved [RESOLVED] run sub every x minutes

    lets say i have a routine

    private sub dostuff()
    'do things
    end sub

    but i want it to run every 15 minutes

    is there some code i can add that can do that?

  2. #2
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: run sub every x minutes

    try this
    Private Sub Form_Load()
    Timer1.Interval = 60000
    Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Timer()
    Static t As Long
    If (t = 0) Then
    Do things here
    Debug.Print Now
    End If
    t = (t + 1) Mod 15 '15 minutes
    End Sub
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Re: run sub every x minutes

    thanks, looks good

  4. #4
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: run sub every x minutes


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width