Hi,

I have a macro which will not run because it is to large. How do I split the
macro into two macros so that after the first macro the second automatically
runs. Could you please help me with the code. My macros are simply named
Macro 1 and Macro 2.

Thank you

Re: Split Long Macro by Tony

Tony
Mon Jan 21 04:45:06 PST 2008

If you don't know enough to do this on your own, I presume you have
relatively simple, if long, and probably recorded, macros so there shouldn't
be any major issues, and this may work ...

Sub Macro1
' Do a lot of stuff
Macro2
End Sub
Sub Macro2
' do a lot more stuff
End Sub

Clearly this is simplistic, and if you do have complex code, copied from
elsewhere perhaps, there may be many things to consider and a more
comprehensive examination of the code will be needed to break it into
logical, independent, parts.

--
Enjoy,
Tony

"Doc60" <Doc60@discussions.microsoft.com> wrote in message
news:F2B349E0-0534-438A-B751-31A0B4DAE592@microsoft.com...
> Hi,
>
> I have a macro which will not run because it is to large. How do I split
> the
> macro into two macros so that after the first macro the second
> automatically
> runs. Could you please help me with the code. My macros are simply named
> Macro 1 and Macro 2.
>
> Thank you


Re: Split Long Macro by fumei

fumei
Mon Jan 21 10:51:37 PST 2008

"I have a macro which will not run because it is to large."

How, exactly, do you know this? Are you getting an error message? If so,
what message?

Doc60 wrote:
>Hi,
>
>I have a macro which will not run because it is to large. How do I split the
>macro into two macros so that after the first macro the second automatically
>runs. Could you please help me with the code. My macros are simply named
>Macro 1 and Macro 2.
>
>Thank you

--
Message posted via http://www.officekb.com


Re: Split Long Macro by Tony

Tony
Mon Jan 21 11:08:22 PST 2008

Hi Gerry,

64K is the maximum size, above which you get a compile error: procedure too
large - unusual for its clarity.

--
Enjoy,
Tony

"fumei via OfficeKB.com" <u37563@uwe> wrote in message
news:7e8d8db09af0b@uwe...
> "I have a macro which will not run because it is to large."
>
> How, exactly, do you know this? Are you getting an error message? If so,
> what message?
>
> Doc60 wrote:
>>Hi,
>>
>>I have a macro which will not run because it is to large. How do I split
>>the
>>macro into two macros so that after the first macro the second
>>automatically
>>runs. Could you please help me with the code. My macros are simply named
>>Macro 1 and Macro 2.
>>
>>Thank you
>
> --
> Message posted via http://www.officekb.com
>