ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro question (https://www.excelbanter.com/excel-discussion-misc-queries/165277-macro-question.html)

GILBERT

Macro question
 
I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.

John Bundy

Macro question
 
On the left side of the screen where you built the macro, you should see a
project folder that lists all of the sheets (CTL-R if you don't see it)
double-click the ThisWorkbook icon, and then at the top there are 2 drop
downs, chose the one on the left and select workbook, it will automatically
open the open event for the workbook, paste your code there.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Gilbert" wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.


Gord Dibben

Macro question
 
Right-click on Excel Icon left of "File" on menubar.

Select "View Code.

Select Workbook from left side dialog box to get these lines

Private Sub Workbook_Open()

End Sub

enter your macro name between like

Private Sub Workbook_Open()
macroname
End Sub

This assumes that you have macroname installed in a module in the workbook.


Gord Dibben MS Excel MVP

On Thu, 8 Nov 2007 08:33:01 -0800, Gilbert
wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.



GILBERT

Macro question
 
That worked John, Thanks for your help. As you can see, I am new to macros
so this community and knowlegable people like yourself make our daily tasks
easier and fun.

"John Bundy" wrote:

On the left side of the screen where you built the macro, you should see a
project folder that lists all of the sheets (CTL-R if you don't see it)
double-click the ThisWorkbook icon, and then at the top there are 2 drop
downs, chose the one on the left and select workbook, it will automatically
open the open event for the workbook, paste your code there.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Gilbert" wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.


GILBERT

Macro question
 
Thanks for your help gord works great.

"Gord Dibben" wrote:

Right-click on Excel Icon left of "File" on menubar.

Select "View Code.

Select Workbook from left side dialog box to get these lines

Private Sub Workbook_Open()

End Sub

enter your macro name between like

Private Sub Workbook_Open()
macroname
End Sub

This assumes that you have macroname installed in a module in the workbook.


Gord Dibben MS Excel MVP

On Thu, 8 Nov 2007 08:33:01 -0800, Gilbert
wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.




GILBERT

Macro question
 
What if my macro is saved on my personal macro workbook instead of that
particular spreadsheet?

"Gord Dibben" wrote:

Right-click on Excel Icon left of "File" on menubar.

Select "View Code.

Select Workbook from left side dialog box to get these lines

Private Sub Workbook_Open()

End Sub

enter your macro name between like

Private Sub Workbook_Open()
macroname
End Sub

This assumes that you have macroname installed in a module in the workbook.


Gord Dibben MS Excel MVP

On Thu, 8 Nov 2007 08:33:01 -0800, Gilbert
wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.




Gord Dibben

Macro question
 
Either copy the code from the macro and paste directly between the lines or add
this line.

Private Sub Workbook_Open()
Application.Run ("Personal.xls!macroname")
End Sub


Gord

On Thu, 8 Nov 2007 09:32:04 -0800, Gilbert
wrote:

What if my macro is saved on my personal macro workbook instead of that
particular spreadsheet?

"Gord Dibben" wrote:

Right-click on Excel Icon left of "File" on menubar.

Select "View Code.

Select Workbook from left side dialog box to get these lines

Private Sub Workbook_Open()

End Sub

enter your macro name between like

Private Sub Workbook_Open()
macroname
End Sub

This assumes that you have macroname installed in a module in the workbook.


Gord Dibben MS Excel MVP

On Thu, 8 Nov 2007 08:33:01 -0800, Gilbert
wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.





GILBERT

Macro question
 
Thanks for all your help.

"Gord Dibben" wrote:

Either copy the code from the macro and paste directly between the lines or add
this line.

Private Sub Workbook_Open()
Application.Run ("Personal.xls!macroname")
End Sub


Gord

On Thu, 8 Nov 2007 09:32:04 -0800, Gilbert
wrote:

What if my macro is saved on my personal macro workbook instead of that
particular spreadsheet?

"Gord Dibben" wrote:

Right-click on Excel Icon left of "File" on menubar.

Select "View Code.

Select Workbook from left side dialog box to get these lines

Private Sub Workbook_Open()

End Sub

enter your macro name between like

Private Sub Workbook_Open()
macroname
End Sub

This assumes that you have macroname installed in a module in the workbook.


Gord Dibben MS Excel MVP

On Thu, 8 Nov 2007 08:33:01 -0800, Gilbert
wrote:

I created a macro in excel 2003. I would like the macro to run automatically
every time I open that particular spreasheet. Thank you in advance.






All times are GMT +1. The time now is 01:23 PM.

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