ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   run macro on workbook open (https://www.excelbanter.com/excel-discussion-misc-queries/16052-run-macro-workbook-open.html)

kevin

run macro on workbook open
 
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?

Kassie

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?


Kassie

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?


Harald Staff

Almost:

Private Sub Workbook_Open()
Call XYZ
End Sub

in the ThisWorkbook module

HTH. Best wishes Harald

"kevin" skrev i melding
...
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?





All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com