Importing Custom (ud) functons from Excel to Access

  • Thread starter Thread starter H_D
  • Start date Start date
H

H_D

I've written a number of user-defined / custom functions and saved them as
modules in Excel. Is there an easy way to import them for use in Access.
These functions refer to parameters, names and tables in the particular excel
workbook (though they could all presumably be saved as an add-in).

What is the best way to make use of these functions in Access?

H_D
 
Thanks.

Do you mean that I should copy the code, or is there some way to move the
entire module, including the functions etc into the access VBA editor? (Or
perhaps somehow save the module in excel then open in Access?)

With regards to the functions referencing figures in Excel, will these
figures need to be copied into an Access table, or left in the excel
spreadsheet?

H
 
You can do an export/import that will move modules from Excel to Access.
In the VBA editor in Excel, open the module you want to move to Access.
File, Export
You will get a common file dialog that allows you to choose the destination
location and file name. It will have an extension of .bas - Leave the
extension as it is.
Then Save. It will put a file in the selected folder with the modulename.bas

Now, to get it into Acces. In the VBA editor
File, Import. - Navigate to the .bas file and click open. It will import
the module as a module in you mdb.
 
Back
Top