How do I get a macro to run automatically when I open a sheet?

How do I schedule a macro to run automatically?

I am working on a script that will schedule an email to be sent at a given time every week.

I am not sure how to do this. I have been researching this for the past couple of days and I can't seem to find a solution that will work for me. The ideal solution would be to be able to set up the macro to run automatically and not have to manually enter the schedule every week.

Thank you in advance for any help. You need to schedule a Task or a Macro.

How do I auto enable macros when opening a workbook?

I am trying to create a macro for my workbook that when I open it auto enabled the macros I have used in the cells in the first sheet with the name of 'input'. I will be working on the input sheets, so I need to be able to change them as I go.

My attempt so far: Sub OpenVBA(). Dim ws As Worksheet. Dim strFile As String. Dim strPath As String. strPath = Application.ActiveWorkbook.path
strFile = Dir(strPath & "*xlsm"). Do While strFile <> "". ActiveWorkbook.EnableMacros = False ActiveWorkbook.Open strPath & "" & strFile ActiveWorkbook.EnableMacros = True Loop. End Sub. The following code worked well for me; the macros are now automatically active with each workbook (as it has been saved): Sub AutoEnableMacro(). For Each ws In ThisWorkbook.Worksheets If ws.Name = "Name of Input Sheet" Then

Related Answers

How do I record and save a macro in Excel?

It's really easy. Create a new macro, like this: Sub...

Does Excel 2016 have Macros?

After I used the Microsoft Office Assistant tool to clean up my Excel spreads...

Is there a way to automate Excel reports?

I'm looking for a way to generate an excel macro that will ope...