Solved

VBA Function - How do I call it

Posted on 2014-03-11
6
268 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

705 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