Excel

TheSmallman.com

an XL ideas Lab

Dashboards VBA
  • Home
  • Dashboards
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
    • Power Pivot a User Guide
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About
Menu

Excel Dashboards VBA

Street Address
City, State, Zip
Phone Number
an XL ideas Lab

Your Custom Text Here

Excel Dashboards VBA

  • Home
  • Dashboards
  • Excel Tips
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
  • PowerPivot
    • Power Pivot a User Guide
  • Courses
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About

Run Macro Overnight Automatically

June 24, 2024 Marcus Small

Photo by Carlos Muza on Unsplash

Running a macro automatically is possible. The first thing to say about this procedure is you need to keep Excel running on your machine when you leave the office. Incidentally this procedure can be run at any time of the day or night. I just found it most useful running larger processes over night. I have run processes overnight and they run really well provided you leave your computer on and Excel open. The process will start at the designated time and perform the tasks as if you were there pressing a button. The following is the procedure.

Private Sub Workbook_Open()
    Application.OnTime TimeValue("02:15:00"), "RunAuto"
End Sub

Sub RunAuto()
    Dim Msg As Integer
    Msg = MsgBox("This Runs!!!", vbOKOnly + vbInformation, "Running Automatically")
End Sub

The first part of the procedure generates the action that allows the process to ‘kick off’ as it were. The second part of the process is the macro that ‘does stuff’. In the above case I have kept it simple and the stuff being done is a message box that pops up at 2.15 am that proves the concept. The macro is called RunAuto it could be called anything but notice how “RunAuto” is referred to in the first procedure? This tells Excel what process to run.

Source:
Tags Excel, Macro, Run Automatically
← Excel Show Missing Sheet TabsSplit File into Parts and Save to Directory →

Featured Posts

Excel Dashboards: Tracking a Crisis

Excel Dashboards: Tracking a Crisis
April 14, 2020

Recent Posts

Populating an Excel Table from a Range of Cells with VBA

Populating an Excel Table from a Range of Cells with VBA June 12, 2025

Fuzzy Distribution with Randbetween

Fuzzy Distribution with Randbetween May 21, 2025

Add Minimum and Maximum for Chart in Cells

Add Minimum and Maximum for Chart in Cells March 12, 2025

Inflation Over Multiple Years in a Single Cell

Inflation Over Multiple Years in a Single Cell January 10, 2025

Hubspot Dashboard

Hubspot Dashboard October 3, 2024

Monthly Dashboard With Supporting Metrics

Monthly Dashboard With Supporting Metrics September 25, 2024

Excel Show Missing Sheet Tabs

Excel Show Missing Sheet Tabs July 29, 2024

Run Macro Overnight Automatically

Run Macro Overnight Automatically June 24, 2024

Split File into Parts and Save to Directory

Split File into Parts and Save to Directory April 20, 2024

Most Popular Author

Most Popular Author December 14, 2023

 

Follow US:

 
 

MarcusSmall@thesmallman.com

 

TheSmallman.com - Making your small systems hum...
© Copyright 2013-2024 theSmallman.com All Rights Reserved.