copying VBA from one Excel file to another

O

Okieviking

I have collected several spreadsheets calculators useful for different
applications. To protect them from users changing stuff, and losing the
files, I have combined them all in one file. I have then created a VBA code
and changed the file into an addin. When the file is opened, the user gets
an extra menu on the menu bar, with a drop down list of the different
calculators I have collected. When the user picks the calculator he wants,
the macro creates a new xl file and copies the appropriate xl sheet that
contains the desired calculator from the addin to a new sheet. Simple,
effective, and good housekeeping.

The problem occured when I bumped into a calculator that contains a number
of VBA functions in a module. Copying the sheet over won't do the trick any
more. Is there a way to copy over the functions as well. Or, is there a way
to make the functions (and maybe sub statements) located in the addin be
called up from the spreadsheet I copy over?

The functions are called up from cells in the worksheet as follows:

=interplookup2d(D4;D3;$C$22:$O$29)
 
J

Joel

Create a macro that puts the functions into the worksheet like this

Range("A1").formula = "=interplookup2d(D4;D3;$C$22:$O$29)"

either when you install the add-in or when the workbook is opened rn that
macro that puts the functions into the workbook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top