Hi,
I have a macro that sorts a table. what do i need to do to have this macro
run every time the workbook is opened? is it simply run XYZ() under the
object this workbook?
Hi,
I have a macro that sorts a table. what do i need to do to have this macro
run every time the workbook is opened? is it simply run XYZ() under the
object this workbook?
Good morning Kevin
Two ways of doing this:
The old way - this method was the way to do it pre XL97 but still works OK for compatibility purposes. Call your macro auto_open(). And that's it.
The new way - with XL97 onwards came event procedures. You could call your macro workbook_open() and drop it into the "This Workbook" event in the VBE.
Either of those will do.
HTH
DominicB
In Excel, press <Alt><F11>, type in Workbookopen and click on search
"kevin" wrote:
> Hi,
>
> I have a macro that sorts a table. what do i need to do to have this macro
> run every time the workbook is opened? is it simply run XYZ() under the
> object this workbook?
Sorry, once in VB, click on <F1>, and then do the typing
"kevin" wrote:
> Hi,
>
> I have a macro that sorts a table. what do i need to do to have this macro
> run every time the workbook is opened? is it simply run XYZ() under the
> object this workbook?
Almost:
Private Sub Workbook_Open()
Call XYZ
End Sub
in the ThisWorkbook module
HTH. Best wishes Harald
"kevin" <[email protected]> skrev i melding
news:[email protected]...
> Hi,
>
> I have a macro that sorts a table. what do i need to do to have this macro
> run every time the workbook is opened? is it simply run XYZ() under the
> object this workbook?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks