Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

using function across multiple

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Using a function across multiple workbooks

Using a function across multiple workbooks

ResolvedVersion 2010

Orla has attended:
Excel VBA Intro Intermediate course
Access Intermediate course

Using a function across multiple workbooks

Hi,

I have set up a code that starts in file A, opens file B, and runs code on the new file B.

However, I have set up a function in file A that i need to use in file B. the code all runs perfectly, however, the function doesn't seem to work in file B.

The function is used to get the date from the week number, and while it works in file A, I can't see it at all in file B.

How can I share a function across multiple workbooks?

Thanks! :)

RE: Using a function across multiple workbooks

Hi Orla

Thanks for getting in touch. Much like increasing the scope (visibility) of variables, you can do the same with functions.

Try prefixing your function with 'Public', e.g. Public Function MyFunct(x,y)...

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 24 Dec 2012: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Validating text entries

1. Select the range of cells.
2. From the Data menu, select Validation.
3. Select the Settings tab.
4. From the Allow dropdown list, select Custom.
5. In the Formula box, enter the following formula:

=IsText (A1)

where A1 is the first cell in the range.
6. Click OK.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.