Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro to run Command Buttons

Hi

I have 13 individual macros assigned to 13 individual command buttons on 13
separate sheets. I would like one more command button with a macro that runs
all of the other 13 macros/buttons.

thanks
Leigh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Macro to run Command Buttons

create the following procedure in a module:

sub RunAllMacros

call Macro1
call Macro2
....
call Macro 13

end sub

create the new command button and assign the macro "RunAllMacros" to it.

Sam

"Leigh Douglass" wrote:

Hi

I have 13 individual macros assigned to 13 individual command buttons on 13
separate sheets. I would like one more command button with a macro that runs
all of the other 13 macros/buttons.

thanks
Leigh

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to run Command Buttons

Just to add on.... please make sure sheets are refered properly within your
macro like Sheets("Sheename"). and not as ActiveSheet. or ActiveCell.

If this post helps click Yes
---------------
Jacob Skaria


"Leigh Douglass" wrote:

Hi

I have 13 individual macros assigned to 13 individual command buttons on 13
separate sheets. I would like one more command button with a macro that runs
all of the other 13 macros/buttons.

thanks
Leigh

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Macro to run Command Buttons

You will need to insert a Call at the end of each sub.
Like this:
Call mysub()

Remember, VBA executes in linear fashion, so call the second sub from the
first, call the third sub from the second, etc.

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Leigh Douglass" wrote:

Hi

I have 13 individual macros assigned to 13 individual command buttons on 13
separate sheets. I would like one more command button with a macro that runs
all of the other 13 macros/buttons.

thanks
Leigh

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Macro to run Command Buttons

Leigh

Something like the following in the code module for the sheet with the
button that runs all 13 should work:

Option Explicit

Private Sub CommandButton1_Click()
MsgBox "test 1"
End Sub

Private Sub CommandButton3_Click()
Call CommandButton1_Click
Call Sheet2.CommandButton1_Click
Call Sheet3.CommandButton1_Click
End Sub

You need to make sure the commond button procedures on the sheets
other than the calling sheet are not Private.

Good luck.

Ken
Norfolk, Va


On May 28, 9:53*am, Leigh Douglass
wrote:
Hi

I have 13 individual macros assigned to 13 individual command buttons on 13
separate sheets. *I would like one more command button with a macro that runs
all of the other 13 macros/buttons.

thanks
Leigh


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
Form buttons and Control Command Buttons ranswrt Excel Programming 0 August 7th 08 11:36 PM
Macro to insert command buttons WLMPilot Excel Programming 8 March 19th 08 02:51 AM
Creating command buttons beside every row to execute each row macro sirriff Excel Programming 3 September 12th 04 03:42 AM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM
Command buttons not available Donna Brooks Excel Programming 0 August 25th 03 04:23 PM


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