Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8683653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:06:15+00:00 2026-06-12T22:06:15+00:00

I have a spreadsheet that runs every minute between 8am to 4pm that imports

  • 0

I have a spreadsheet that runs every minute between 8am to 4pm that imports files from a certain folder and does certain calculations

The calculations are done to check if a limit has been breached. If a limit has been breached then the spreadsheet needs to notify the user through a sound alert and email alert. The requirement is for the sound alert to go off every minute while the email alert is supposed to go off every 45 minutes as they dont want to be spammed with emails.

public sub fileImport()
     if between 0800 to 1600
         //do file import
         //do calculations
         if breach sound alert             
     end if   
     Application.OnTime RunEveryMinute, fileImport

     if there is a breach
         sendMail()         
         Application.OnTime RunEvery45Min, sendMail              
     end if

public sub sendEmail()
     //do email function

so how can i go about in calling the sendEmail sub only every 45 minutes instead of every minute?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:06:17+00:00Added an answer on June 12, 2026 at 10:06 pm

    Assuming this is in a loop just record the last send time and compare it to Now;

    Public Sub sendEmail()
        Static lastSent As Date
        If DateDiff("m", lastSent, Now) > 45 Then
             '//do email function
             lastSent = Now
        End If
    End Sub
    

    (This will send the very first time its invoked too)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like many, I have spreadsheet that draws data from over 40 text files as
I have an Excel spreadsheet that I have exported from some other program. It
I have an Excel spreadsheet that needs to display data from our SQL database.
I have a spreadsheet that I am sorting based on an item number column.
I have an Excel spreadsheet that uses a TFS query to pull information on
I have an Excel spreadsheet that looks like: spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg I'd like to convert
I have an Excel spreadsheet that will sit out on a network share drive.
I have an excel spreadsheet that is password-protected. I need to open this spreadsheet
I have an excel spreadsheet that has two columns. When I choose to save
I have an xl spreadsheet that I'd like to scrap. I'll replace it with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.