#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macros on excel

I'am sorry but i like to know how can activate a macro when i open a worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default Macros on excel

Alt+F11 to open the VB editor. Double-click on ThisWorkbook. Click
drop-down and select Workbook. Click second drop-down and select Open.
Then paste your code there.


"AJPG" wrote in message
...
I'am sorry but i like to know how can activate a macro when i open a
worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 195
Default Macros on excel

You can do it through VBA
open the workbook
press "ALT" F11"
this opens the VB editor will open
Under the project explorer.
double click on "this workbook " and then in the code window
paste as below ...you need to replace NameOfMacro with your Macro name
go back to excel and save the workbook.
And next time you open it - it will ask to enable macros ...so say
Enable
and then the macro will run.

Private Sub Workbook_Activate()

Call NameOfMacro

End Sub

AJPG wrote:
I'am sorry but i like to know how can activate a macro when i open a worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Macros on excel

Try this-- Open the Visual Basic Editor by going to the 'Tools' menu, open
'Macros...', and select Visual Basic Editor.

On the left side of the VBE you will see the project window (will list the
sheets in the current workbook).
1. Double Click 'ThisWorkbook' from the project window
2. At the top center, you will see a drop down list (General), Select Workbook
- You should now see the following:
Private Sub WorkBook_Open()

End Sub
3. Enter a statement to call your macro once the workbook is opened:
Private Sub WorkBook_Open()
Call YourMacroNameHere
End Sub

YourMacroNameHere = the name you gave your macro. Now when you open the
workbook the macro will run.

"AJPG" wrote:

I'am sorry but i like to know how can activate a macro when i open a worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macros on excel



"PCLIVE" wrote:

Alt+F11 to open the VB editor. Double-click on ThisWorkbook. Click
drop-down and select Workbook. Click second drop-down and select Open.
Then paste your code there.


"AJPG" wrote in message
...
I'am sorry but i like to know how can activate a macro when i open a
worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macros on excel



"stevebriz" wrote:

You can do it through VBA
open the workbook
press "ALT" F11"
this opens the VB editor will open
Under the project explorer.
double click on "this workbook " and then in the code window
paste as below ...you need to replace NameOfMacro with your Macro name
go back to excel and save the workbook.
And next time you open it - it will ask to enable macros ...so say
Enable
and then the macro will run.

Private Sub Workbook_Activate()

Call NameOfMacro

End Sub

AJPG wrote:
I'am sorry but i like to know how can activate a macro when i open a worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Macros on excel



"sjk153" wrote:

Try this-- Open the Visual Basic Editor by going to the 'Tools' menu, open
'Macros...', and select Visual Basic Editor.

On the left side of the VBE you will see the project window (will list the
sheets in the current workbook).
1. Double Click 'ThisWorkbook' from the project window
2. At the top center, you will see a drop down list (General), Select Workbook
- You should now see the following:
Private Sub WorkBook_Open()

End Sub
3. Enter a statement to call your macro once the workbook is opened:
Private Sub WorkBook_Open()
Call YourMacroNameHere
End Sub

YourMacroNameHere = the name you gave your macro. Now when you open the
workbook the macro will run.

"AJPG" wrote:

I'am sorry but i like to know how can activate a macro when i open a worksheet.
I have done a macro (ctrl+a) that do wat i want, but i must run it when i
open the worksheet.

Thanks in advance
Pinto Guimaraes

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How to remove excel macros still there after normal delete? James Excel Discussion (Misc queries) 1 April 20th 06 09:45 PM
I deleted all macros in Excel but still get dialog box VenitaC Excel Discussion (Misc queries) 2 September 19th 05 07:05 PM
Are macros created in Excel 2003 compatible with Excel 5.0/95? Hakmui Excel Discussion (Misc queries) 1 August 31st 05 01:33 AM
How do I update Excel 2000 macros to work in Excel 2002? BobPetrich Excel Discussion (Misc queries) 3 January 4th 05 04:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"