startup macro does not execute

A

Artie

I created a macro named auto_run to run when I open a specific workbook. It
does not run upon opening the workbook but it does run when I go to Tools
macro run.
The instructions are
sheets ("consolidated") . select
range ("f11") . select
end sub

Macro security is set to low.
 
R

RB Smissaert

Did you put it in the ThisWorkbook module of that workbook?

In that module put it in:
Private Sub Workbook_Open()

RBS
 
J

JLGWhiz

You neet to use the Workbook_Open event and put the macro in the ThisWorkbook
code module. Open the VBE, double click ThisWorkbook in the Project pane and
paste this in the code window. Save, close the workbook and re-open it.

Private Sub Workbook_Open()
Sheets ("consolidated") . select
Range ("f11") . select
End sub
 
D

Don Guillett

Name your macro

sub Auto_Open()
place in a REGULAR module

now in the ThisWorkook module add another macro

Private Sub Workbook_Open()
call Auto_open
End Sub

Now you have covered ALL contingencies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top