run a macro inside another

Billy C

Board Regular
Joined
Aug 26, 2005
Messages
52
Can any one tell me how to run a macr inside another, I require a macro to run which will produce a value i then use this value in an within my main macro.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
A macro which will produce a value can be made into a function. What is the code you have for this macro which will produce a value?
 
Upvote 0
Range("AT2").Select
Selection.End(xlDown).Select
Selection.cut
Range("AU2").Select
ActiveSheet.Paste

Note this macro is in a sheet on my workbook, i am using the value in cell AU2 within a user form macro
 
Upvote 0
Your macro alters cells with a sheet, so can't be made into a function. What is the name of the macro now? Why have you stored it in the sheet code area of the workbook? Are you sure you've stored it the sheet code area ... and if so, what is the sheet name.

What have you tried in the way of calling this macro so far?
 
Upvote 0
Macro name "Cut"
Sheet is named "RefTables"
Stored in Module3

Don't know how to call the macro i have tried Cut.run but this does not work
 
Upvote 0
Simply referring to
Cut
should run it. Not that I'd ever name a macro the same as an Excel reserved word.
 
Upvote 0

Forum statistics

Threads
1,224,271
Messages
6,177,608
Members
452,785
Latest member
3110vba

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
Back
Top