Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
How to remove excel macros still there after normal delete? | Excel Discussion (Misc queries) | |||
I deleted all macros in Excel but still get dialog box | Excel Discussion (Misc queries) | |||
Are macros created in Excel 2003 compatible with Excel 5.0/95? | Excel Discussion (Misc queries) | |||
How do I update Excel 2000 macros to work in Excel 2002? | Excel Discussion (Misc queries) |