PC Review


Reply
Thread Tools Rate Thread

copying VBA from one Excel file to another

 
 
Okieviking
Guest
Posts: n/a
 
      22nd Nov 2009
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)


 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      22nd Nov 2009
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.

"Okieviking" wrote:

> 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)
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying Excel file without opening file windsurferLA Microsoft Excel Programming 2 25th Nov 2007 06:10 PM
reading txt file and copying the lines in new excel file shresthaprateek@gmail.com Microsoft Excel Programming 2 11th Aug 2006 07:20 PM
Problem with copying an EXCEL File =?Utf-8?B?VGV4YXMgR2lybA==?= Microsoft Excel Crashes 0 28th Apr 2006 07:04 PM
Problem copying excel file to pocket excel. Tammy Engel Windows XP Embedded 1 10th Mar 2006 09:47 PM
Copying excel file to word =?Utf-8?B?R2FyeQ==?= Microsoft Excel Misc 1 2nd Nov 2005 10:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:31 AM.