Run a macro within a macro without referencing the file name? Is it possible?

drew.j.harrison

Board Regular
Joined
Jul 9, 2010
Messages
65
So I want to make a macro which runs another macro within that file. Unfortunately when I record my actions I get the following:

Application.Run _
"'TiVCT Purchased Parts Matrix (03-09-11).xls'!Parts_Dropdown_Main"

It works just fine until I change the file name to reflect the current date. Is there anyway I can have it run a macro without having to reference the file name or refer to the current file? Any help is appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
How about saving your macro in the Personal workbook, which you can have automatically open each time you open excel so that it will be available.

Then you could tweak your code with:

Application.Run "'PERSONAL.XLS'!Parts_Dropdown_Main"
 
Upvote 0
Anybody? There has to be some way I can do this short of copying the entire reference macro into the new macro (meaning I would have to update both anytime I decided to tweak them)
 
Upvote 0
How about saving your macro in the Personal workbook, which you can have automatically open each time you open excel so that it will be available.

Then you could tweak your code with:

Application.Run "'PERSONAL.XLS'!Parts_Dropdown_Main"


If I am reading this right you are suggesting I separate the macros from the file and house them in a separate file. That could work fine if I was the only one using this sheet but unfortunately I need to be able to to send it to others to use with working macros and I would prefer not to have to send them a separate macro file with it. Do I understand you correctly or am I missing something?
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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