ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VB code for running a macro (https://www.excelbanter.com/excel-discussion-misc-queries/174019-vbulletin-code-running-macro.html)

rcc

VB code for running a macro
 
Hi,

I'm trying to write a couple lines of code for a macro, call it Macro1. I
want Macro1 to be able to run Macro2. What's the code command for that?

Thanks,
rcc

Jim Cone

VB code for running a macro
 

Sub Macro1
'somecode
Macro2
'optional additional code
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"rcc"
wrote in message
Hi,
I'm trying to write a couple lines of code for a macro, call it Macro1. I
want Macro1 to be able to run Macro2. What's the code command for that?
Thanks,
rcc

Roger Govier[_3_]

VB code for running a macro
 
Hi

Try
Sub Macro1()
your code

Call macro2

more code

End Sub


--

Regards
Roger Govier

"rcc" wrote in message
...
Hi,

I'm trying to write a couple lines of code for a macro, call it Macro1. I
want Macro1 to be able to run Macro2. What's the code command for that?

Thanks,
rcc



Dave Peterson

VB code for running a macro
 
call macro2

is one way.

rcc wrote:

Hi,

I'm trying to write a couple lines of code for a macro, call it Macro1. I
want Macro1 to be able to run Macro2. What's the code command for that?

Thanks,
rcc


--

Dave Peterson


All times are GMT +1. The time now is 01:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com