Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VB Excel Macro

I have a VB Macro in an Excel spreadsheet that I want to use in other
spreadsheets. What is the most efficient way to do this without copying the
macro code from sheet to sheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VB Excel Macro

It depends on how that macro is written (and what it does).

It could be as simple as opening the macro workbook, activating the "real"
workbook and the sheet that should be processed, then hitting alt-F8 and
selecting the macro and running it.

This could even work if the code was written to work on the activesheet <bg.

ajmplanner wrote:

I have a VB Macro in an Excel spreadsheet that I want to use in other
spreadsheets. What is the most efficient way to do this without copying the
macro code from sheet to sheet.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default VB Excel Macro

When you say spreadsheet are you referring to a worksheet within a file or
to the file itself.
What kind of macro. Always BEST to post YOUR macro for comments.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ajmplanner" wrote in message
...
I have a VB Macro in an Excel spreadsheet that I want to use in other
spreadsheets. What is the most efficient way to do this without copying
the
macro code from sheet to sheet.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VB Excel Macro

Thanks for your replies. The macro simply parses some information in a cell
of each row of a worksheet and places the parsed info in other columns on
that row. I receive the unparsed information in a different Excel file each
month. I was under the impression that a macro built for that worksheet was
"attached" to that Excel file and could not access worsheets in another Excel
file.

"Dave Peterson" wrote:

It depends on how that macro is written (and what it does).

It could be as simple as opening the macro workbook, activating the "real"
workbook and the sheet that should be processed, then hitting alt-F8 and
selecting the macro and running it.

This could even work if the code was written to work on the activesheet <bg.

ajmplanner wrote:

I have a VB Macro in an Excel spreadsheet that I want to use in other
spreadsheets. What is the most efficient way to do this without copying the
macro code from sheet to sheet.


--

Dave Peterson
.

  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default VB Excel Macro

You use three terms............spreadsheet, worksheet and file.

Do you mean workbook and worksheet?

Do you have a simple macro like

Sub Macro()

do things

End Sub

Or is the code a worksheet event type like worksheet_change?

If a simple macro, create an add-in from a workbook with the macro in a
module.

Add that add-in to your list of installed and loaded add-ins.

The macro will be availanle for all open workbooks.

Or if just for your own use, place the macro in your Personal.xls workbook.

If event type code, you will have to post it so's we can figure out the best
method of making available.


Gord Dibben MS Excel MVP


On Thu, 4 Mar 2010 08:34:01 -0800, ajmplanner
wrote:

Thanks for your replies. The macro simply parses some information in a cell
of each row of a worksheet and places the parsed info in other columns on
that row. I receive the unparsed information in a different Excel file each
month. I was under the impression that a macro built for that worksheet was
"attached" to that Excel file and could not access worsheets in another Excel
file.

"Dave Peterson" wrote:

It depends on how that macro is written (and what it does).

It could be as simple as opening the macro workbook, activating the "real"
workbook and the sheet that should be processed, then hitting alt-F8 and
selecting the macro and running it.

This could even work if the code was written to work on the activesheet <bg.

ajmplanner wrote:

I have a VB Macro in an Excel spreadsheet that I want to use in other
spreadsheets. What is the most efficient way to do this without copying the
macro code from sheet to sheet.


--

Dave Peterson
.


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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
translate lotus 1-2-3 macro into excel macro using excel 2000 krutledge0209 Excel Programming 1 November 2nd 04 05:50 PM


All times are GMT +1. The time now is 10:05 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"