Calling other macros

Temporary-Failure

Board Regular
Joined
Jul 16, 2010
Messages
137
I have sheet named as "Tilaustiedot". It has button and there's macro Public Sub CommandButton1_Click() attached to it.

How I can run macro "other_macro" which is in the LASKU-sheet?

Just writing Call other_macro into Public Sub CommandButton1_Click() macro doesn't work. There comes error: Compile error:
Sub or function not defined.

How I can call macro from other sheet?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,985
If you move the other macro to a normal module rather than a sheet's code module, the Call command should work.
 

Temporary-Failure

Board Regular
Joined
Jul 16, 2010
Messages
137
But if I use my workbook on other computer? Modules aren't saved into workbook I think? I cannot use macro on other computers?
 

Watch MrExcel Video

Forum statistics

Threads
1,130,119
Messages
5,640,219
Members
417,131
Latest member
Seanr19871

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top