[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to add prompts to user defined function?

Posted on 2016-10-07
6
Medium Priority
?
167 Views
Last Modified: 2016-10-07
I have added the Count_Chars user defined function to my spreadsheets (see below).
I would like to have prompt or help information provided as in in the standard IF function:

Prompts for IF function
---------------------------------------------------------------------------------
Function Count_Chars(Target As String, rng As Range)
   Count = 0
   If Target = "" Then GoTo Done
    For Each c In rng
      N = InStr(1, c.Value, Target)
      While N <> 0
       Count = Count + 1
       N = InStr(N + 1, c.Value, Target)
      Wend
    Next c
  Count_Chars = Count
 Done:
 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
6 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 41833870
try customize:

=IF(Count_Chars("B",A:A) >= 5, "5 or more chars matched", "less than 5 chars matched")

Open in new window

0
 
LVL 27

Expert Comment

by:ProfessorJimJam
ID: 41833871
I don't think what you are asking is possible to be done with user defined functions.
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 41833886
Yes it is possible. Please see my Creating your own Excel formulas and doing the impossible article.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Closing Comment

by:Alex Campbell
ID: 41833904
Great, thanks!!
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41833908
You're welcome and I'm glad I was able to help. And a special thanks for my 4 millionth point!

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0
 
LVL 27

Expert Comment

by:ProfessorJimJam
ID: 41834697
Alex
I am glad that martin's solution has helped you but from what I understood from your question , you wanted to add intellisense
In the UDFs as you can see them in the built in functions. As I confirmed in my message above it is currently not possible to do that however there is a workaround using
Add-in referred in the link below
https://fastexcel.wordpress.com/2016/10/07/writing-efficient-vba-udfs-part-15-adding-intellisense-to-your-udfs/
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

656 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