Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I want to create a macro in Excel 2000 using one already written by
someone else. but all I find are instructions to create one from scratch the normal keyboard/mouse way. Is there a more direct way to create and copy one in? The macro in question is he http://www.cpearson.com/excel/unselect.htm. Thanks, Gene |
#2
![]() |
|||
|
|||
![]()
It's just like copying and pasting text:
Open the VBA (Visual Basic for Applications) editor (how you do this may vary according to the particular version of Excel); in Excel 2003 this is done by selecting Tools menu, Macro command, select Visual Basic Editor from the pop-up menu. Copy the text of the macro you want to use. Paste the text into the VBA macro sheet (either a new module or on the macro sheet associated with a particular worksheet) by selecting the Edit menu, Paste command. Then edit the macro to suit your needs. "Gene Goldenfeld" wrote in message ... I want to create a macro in Excel 2000 using one already written by someone else. but all I find are instructions to create one from scratch the normal keyboard/mouse way. Is there a more direct way to create and copy one in? The macro in question is he http://www.cpearson.com/excel/unselect.htm. Thanks, Gene |
#3
![]() |
|||
|
|||
![]()
Fred Smif wrote:
It's just like copying and pasting text: Open the VBA (Visual Basic for Applications) editor (how you do this may vary according to the particular version of Excel); in Excel 2003 this is done by selecting Tools menu, Macro command, select Visual Basic Editor from the pop-up menu. Copy the text of the macro you want to use. Paste the text into the VBA macro sheet (either a new module or on the macro sheet associated with a particular worksheet) by selecting the Edit menu, Paste command. Then edit the macro to suit your needs. "Gene Goldenfeld" wrote in message ... I want to create a macro in Excel 2000 using one already written by someone else. but all I find are instructions to create one from scratch the normal keyboard/mouse way. Is there a more direct way to create and copy one in? The macro in question is he http://www.cpearson.com/excel/unselect.htm. Thanks, Gene Thanks. What I have been clear about is that in opening VBE there are three windows with different titles (after the WFXL2000.XLS): -1) Print2WinFax (tools) with a macro in it -2) ThisWorkbook (Code) with a little text -3) Sheet1 (Code) with a little text Not sure why WinFax is there, but which do I use? Gene |
#4
![]() |
|||
|
|||
![]() "Gene Goldenfeld" wrote in message ... Fred Smif wrote: It's just like copying and pasting text: Open the VBA (Visual Basic for Applications) editor (how you do this may vary according to the particular version of Excel); in Excel 2003 this is done by selecting Tools menu, Macro command, select Visual Basic Editor from the pop-up menu. Copy the text of the macro you want to use. Paste the text into the VBA macro sheet (either a new module or on the macro sheet associated with a particular worksheet) by selecting the Edit menu, Paste command. Then edit the macro to suit your needs. "Gene Goldenfeld" wrote in message ... I want to create a macro in Excel 2000 using one already written by someone else. but all I find are instructions to create one from scratch the normal keyboard/mouse way. Is there a more direct way to create and copy one in? The macro in question is he http://www.cpearson.com/excel/unselect.htm. Thanks, Gene Thanks. What I have been clear about is that in opening VBE there are three windows with different titles (after the WFXL2000.XLS): -1) Print2WinFax (tools) with a macro in it -2) ThisWorkbook (Code) with a little text -3) Sheet1 (Code) with a little text Not sure why WinFax is there, but which do I use? Gene I assume that you don't want to use the macro specifically (and only) for WinFax so I will ignore it. That leaves "This Workbook" and "Sheet1" (or you can insert a Module from the Insert menu). You can really put your code in any one of these three locations ("This Workbook", "Sheet1", or a new module). Each type of sheet has its own particular best applications (ie: some code is best put in a particular type of sheet)...but this gets into the next lesson. |
#5
![]() |
|||
|
|||
![]()
Gene, put it in a normal module, try this
To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of the "File" menu this will open the VBA editor, in the left hand window click on your workbook name, go to insert, module, and paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook and press alt and F8, this will bring up a box to pick the Macro from, click on the Macro name to run it. -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Gene Goldenfeld" wrote in message ... Fred Smif wrote: It's just like copying and pasting text: Open the VBA (Visual Basic for Applications) editor (how you do this may vary according to the particular version of Excel); in Excel 2003 this is done by selecting Tools menu, Macro command, select Visual Basic Editor from the pop-up menu. Copy the text of the macro you want to use. Paste the text into the VBA macro sheet (either a new module or on the macro sheet associated with a particular worksheet) by selecting the Edit menu, Paste command. Then edit the macro to suit your needs. "Gene Goldenfeld" wrote in message ... I want to create a macro in Excel 2000 using one already written by someone else. but all I find are instructions to create one from scratch the normal keyboard/mouse way. Is there a more direct way to create and copy one in? The macro in question is he http://www.cpearson.com/excel/unselect.htm. Thanks, Gene Thanks. What I have been clear about is that in opening VBE there are three windows with different titles (after the WFXL2000.XLS): -1) Print2WinFax (tools) with a macro in it -2) ThisWorkbook (Code) with a little text -3) Sheet1 (Code) with a little text Not sure why WinFax is there, but which do I use? Gene |
#6
![]() |
|||
|
|||
![]()
Paul B wrote:
Gene, put it in a normal module, try this To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of the "File" menu this will open the VBA editor, in the left hand window click on your workbook name, go to insert, module, and paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook and press alt and F8, this will bring up a box to pick the Macro from, click on the Macro name to run it. -- Paul B Ok, that worked. And to Fred, I see that it went in the Sheet page. Next question: How do I make this macro general, so that it works in all workbooks? I tried it in another and it didn't quite work the same each time. Gene |
#7
![]() |
|||
|
|||
![]()
Paul B wrote:
Gene, put it in a normal module, try this To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of the "File" menu this will open the VBA editor, in the left hand window click on your workbook name, go to insert, module, and paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook and press alt and F8, this will bring up a box to pick the Macro from, click on the Macro name to run it. This one is not over yet. I can run the macro, but can't copy it to another workbook (or otherwise make it general and not just workbook specific). Help says to open both workbooks, then VBE, then View/Project Explorer, then drag the module to the other workbook. I don't see what it is I'm supposed to drag; i.e., I don't see the macro in the Project - VBAProject list. Thanks. Gene |
#8
![]() |
|||
|
|||
![]()
Gene, if you want it available to all your workbooks put it in your
Personal.xls You may also what to have a look here on getting started with macros http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Gene Goldenfeld" wrote in message ... Paul B wrote: Gene, put it in a normal module, try this To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of the "File" menu this will open the VBA editor, in the left hand window click on your workbook name, go to insert, module, and paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook and press alt and F8, this will bring up a box to pick the Macro from, click on the Macro name to run it. This one is not over yet. I can run the macro, but can't copy it to another workbook (or otherwise make it general and not just workbook specific). Help says to open both workbooks, then VBE, then View/Project Explorer, then drag the module to the other workbook. I don't see what it is I'm supposed to drag; i.e., I don't see the macro in the Project - VBAProject list. Thanks. Gene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating array formulaes in macro | Excel Discussion (Misc queries) | |||
Creating a macro in excel | Excel Worksheet Functions | |||
I need help with creating a special macro . | Excel Worksheet Functions | |||
after creating macro button, closed excel then restarted excel | Excel Discussion (Misc queries) | |||
Creating a macro | Excel Worksheet Functions |