Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Gene Goldenfeld
 
Posts: n/a
Default Creating a macro

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   Report Post  
Fred Smif
 
Posts: n/a
Default

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   Report Post  
Gene Goldenfeld
 
Posts: n/a
Default

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   Report Post  
Fred Smif
 
Posts: n/a
Default


"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   Report Post  
Paul B
 
Posts: n/a
Default

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   Report Post  
Gene Goldenfeld
 
Posts: n/a
Default

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   Report Post  
Gene Goldenfeld
 
Posts: n/a
Default

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   Report Post  
Paul B
 
Posts: n/a
Default

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
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
Creating array formulaes in macro Raj Excel Discussion (Misc queries) 1 April 28th 05 09:20 AM
Creating a macro in excel Not sure what I am doing Excel Worksheet Functions 1 March 25th 05 11:04 PM
I need help with creating a special macro . JulianB Excel Worksheet Functions 9 March 4th 05 03:09 PM
after creating macro button, closed excel then restarted excel hjd43 Excel Discussion (Misc queries) 1 March 3rd 05 03:04 AM
Creating a macro Macro Insite Excel Worksheet Functions 3 November 25th 04 11:08 PM


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

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

About Us

"It's about Microsoft Excel"