Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run several macros in a row


I have made 15 different macroes, which is part of a report macro.


I want the Userform OK button, to start the macro and then run through
all the macroes.

however my problem now is that the macro stops after the first End
Sub.
Is there a way to tell the macro to start directly on the next "Sub
macro2 ()" .



Thanks


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=474743

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Run several macros in a row

Set OK button to Use a Macro(StartAllMacros) to call all other Macros
(Macro1, Macro2...)

sub StartAllMacros()
macro1
macro2
macro3
....
end sub

"Ctech" wrote:


I have made 15 different macroes, which is part of a report macro.


I want the Userform OK button, to start the macro and then run through
all the macroes.

however my problem now is that the macro stops after the first End
Sub.
Is there a way to tell the macro to start directly on the next "Sub
macro2 ()" .



Thanks


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=474743


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Run several macros in a row

Have the ok button run all your macros:

sub commandbutton1_click()
call macro1
call macro2
call macro3
end sub



Ctech wrote:

I have made 15 different macroes, which is part of a report macro.

I want the Userform OK button, to start the macro and then run through
all the macroes.

however my problem now is that the macro stops after the first End
Sub.
Is there a way to tell the macro to start directly on the next "Sub
macro2 ()" .

Thanks

--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=474743


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Run several macros in a row

my macros are sub print xx()
end sub
will call "sub print xx" run the sub without more code
"Dave Peterson" wrote:

Have the ok button run all your macros:

sub commandbutton1_click()
call macro1
call macro2
call macro3
end sub



Ctech wrote:

I have made 15 different macroes, which is part of a report macro.

I want the Userform OK button, to start the macro and then run through
all the macroes.

however my problem now is that the macro stops after the first End
Sub.
Is there a way to tell the macro to start directly on the next "Sub
macro2 ()" .

Thanks

--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=474743


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run several macros in a row

Private Sub Commandbutton1_click()
macro1
macro2
macro3
.. . .
macro14
macro15
end Sub

just call the macros sequentially.

--
Regards,
Tom Ogilvy

"Ctech" wrote in
message ...

I have made 15 different macroes, which is part of a report macro.


I want the Userform OK button, to start the macro and then run through
all the macroes.

however my problem now is that the macro stops after the first End
Sub.
Is there a way to tell the macro to start directly on the next "Sub
macro2 ()" .



Thanks


--
Ctech
------------------------------------------------------------------------
Ctech's Profile:

http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=474743





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run several macros in a row


to run several macros inside another macro use the "call" command

EXAMPLE: the names of your recorded macros are "recorded_macro1" &
"recorded_macro2"

sub main()

call recorded_macro1
call recorded_macro2

end sub

i hope this helps. i dont use userforms so i am not sure if this will
work. good luck.


--
tad_wegner
------------------------------------------------------------------------
tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770
View this thread: http://www.excelforum.com/showthread...hreadid=474743

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Run several macros in a row

What will this do when macros are sub end sub
being new this is confusing. have no macros named only sub()end sub

"tad_wegner" wrote:


to run several macros inside another macro use the "call" command

EXAMPLE: the names of your recorded macros are "recorded_macro1" &
"recorded_macro2"

sub main()

call recorded_macro1
call recorded_macro2

end sub

i hope this helps. i dont use userforms so i am not sure if this will
work. good luck.


--
tad_wegner
------------------------------------------------------------------------
tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770
View this thread: http://www.excelforum.com/showthread...hreadid=474743


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
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


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