Solved

VBA Function - How do I call it

Posted on 2014-03-11
6
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 47

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 47

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 47

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

738 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