From: ajmplanner on
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.
From: Dave Peterson on
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
From: Don Guillett on
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
dguillett(a)gmail.com
"ajmplanner" <ajmplanner(a)discussions.microsoft.com> wrote in message
news:A7EC5A99-B0EF-4118-A1B4-827388B90FB9(a)microsoft.com...
>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.

From: ajmplanner on
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
> .
>
From: Don Guillett on
Is there a good reason why you can't post your macro as requested?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett(a)gmail.com
"ajmplanner" <ajmplanner(a)discussions.microsoft.com> wrote in message
news:BED00231-FE5A-4EC7-B170-8ABA5061E2A2(a)microsoft.com...
> 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
>> .
>>