Solved

VBA Function - How do I call it

Posted on 2014-03-11
6
261 Views
Last Modified: 2014-03-11
See attached.

Note the VBA function GetPartNum.

I am trying to call this function but excel sheet cannot seem to find it??

(I did not write the function)

How can I get excel to "find" this function.
SerialNumbersPuzzle.xlsm
0
Comment
Question by:Patrick O'Dea
  • 3
  • 2
6 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39922043
If it's in a code module, the function needs to be Public.
0
 

Author Comment

by:Patrick O'Dea
ID: 39922049
It is public


However, I may be doing some other fundamental thing wrong...

Perhaps you could have a quick look???

:-)
0
 
LVL 46

Assisted Solution

by:Martin Liss
Martin Liss earned 150 total points
ID: 39922050
To call it from another sheet do

Sheet1.GetPartNum 5 ' or whatever value is correct
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 10

Accepted Solution

by:
Anthony Berenguel earned 350 total points
ID: 39922062
I added a module to your workbook and moved your function to it and it runs for me. Give her a go.

ab
SerialNumbersPuzzle.xlsm
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 39922069
Thanks folks - I've got it now!
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39922071
I added a module to your workbook and moved your function to it and it runs for me. Give her a go.
I was going to do that but then I saw that it was homework so I thought I'd leave it to the student. Oh well.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now