workbook A= click vba button that calls a macro button from a different (closed) workbook
There are four sheets in workbook B that use the same module (macro)
how do I go about doing this?
workbook A= click vba button that calls a macro button from a different (closed) workbook
There are four sheets in workbook B that use the same module (macro)
how do I go about doing this?
Save your macros in an XLA file as an Add-In, then you can call them from any book. You can add code to load/unload the add-in if only required for specific workbooks.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Here's the code:
Workbooks("Unfunded Template.xls").Worksheets("My").Range("B12:E14").Select
Selection.ClearContents
It errors out
The code is working off a private sub button click
Is this the code thats supposed to open workbook B?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
If it's convenient, i.e., you are the only one running these macros, as an alternative to Malcom's suggestion about the Add-In, you can put the common macro in your Personal.xls workbook. I tend to prefer that technique, but if other folks will be using this, then the Add-In is probably preferable.
Thanks guys. It now works.
Do I look like I know what I'm doing?