?
Solved

Where should I install this function so it is available to my spreadsheets>

Posted on 2016-10-06
4
Medium Priority
?
56 Views
Last Modified: 2016-10-07
I had this question after viewing Convert Macro to Function.

Function CountNumbersOccurence(LookFor As String, TheRange As Range) As Long
Dim xx
Dim yy
Dim x
yy = TheRange.Value
For Each x In yy
    xx = Split(x,LookFor)
    CountNumbersOccurence = CountNumbersOccurence + UBound(xx)
Next x
End Function
0
Comment
Question by:Alex Campbell
[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
  • 2
4 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41832169
The Function should be placed in a Standard Module, same as you would for a Macro.
0
 
LVL 32

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 2000 total points
ID: 41832259
If you want to make this function available for a specific workbook, you will need to place the code on Standard Module of that specific workbook (as suggested by Rob) and save that workbook as macro-enabled workbook.

But if you want to make this function available for all of your workbooks, open a blank workbook --> Place the code on Standard Module of that blank workbook and save the workbook as Excel Add-in (.xlam) and the file will be saved at the default Add-Ins folder and then close the workbook.
Now open another blank workbook and from Developer Tab, click on Add-Ins and choose the Add-in from the available Add-ins and click OK.
This way you can access the function from any workbook you open.
0
 
LVL 1

Author Closing Comment

by:Alex Campbell
ID: 41833786
Thanks
0
 
LVL 32

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41833863
You're welcome Alex! Glad to help.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

762 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