Calling other macros

Temporary-Failure

Board Regular
Joined
Jul 16, 2010
Messages
140
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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,208
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
140
But if I use my workbook on other computer? Modules aren't saved into workbook I think? I cannot use macro on other computers?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,294
Messages
5,836,464
Members
430,432
Latest member
Spike47

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