PC Review


Reply
Thread Tools Rate Thread

Creating UDF prompts (XL 2007)

 
 
David
Guest
Posts: n/a
 
      7th Oct 2009
I'm trying to get hints/prompts to display for a UDF I've written.

This group had a thread back in 2007 that had the answer, but the link
I found is now dead. Here's the question/answer I found and the old
link. Can anybody provide and answer or a link to the archived
answer.

TIA,
David

------------------------------------------------------------------------------------------
http://groups.google.com/group/micro...6f0180ce2819d5
--
Gary''s Student - gsnu2007a


"michael.beckinsale" wrote:

> Hi All,
>
> With XL2003 built in functions you get prompts for the various
> parameters / arguments as you type into the cell.
>
> eg typing =Sumif( directly into a cell results in this prompt:
>
> SUMIF(range, criteria,[sumrange])
>
> Can this be achieved with UDF and if so how?
>
> Regards
>
> Michael B.
>
>


---------------------------------------------------------------------------------------------------------------------------
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      7th Oct 2009
The Google link is still active:

Here is the response Bob Phillips posted:

From: "Bob Phillips" <phill...@tiscali.co.uk>
Date: Mon, 9 May 2005 10:02:35 +0100
Local: Mon, May 9 2005 5:02 am
Subject: Re: Excel 2002 UDF screen tips
Reply to author | Forward | Print | Individual message | Show original |
Report this message | Find messages by this author
There are a couple of ways, one not too robust, one that requires a dll.

The not too robust way, suggested by Laurent Longre and working for two
parameters is :-
Const Lib = """c:\windows\system\user32.dlÂ*Â*l"""
Option Base 1


Private Function Multiply(N1 As Double, N2 As Double) As Double
Multiply = N1 * N2
End Function


'=============================Â*Â*=============


Private Function Divide(N1 As Double, N2 As Double) As Double
Divide = N1 / N2
End Function


'=============================Â*Â*=============


Sub Auto_open()


Register "DIVIDE", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "CharPrevA"
Register "MULTIPLY", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"CharNextA"


End Sub


'=============================Â*Â*=============


Sub Register(FunctionName As String, NbArgs As Integer, _
Args As String, MacroType As Integer, Category As String, _
Descr As String, DescrArgs As String, FLib As String)


Application.ExecuteExcel4Macro _
"REGISTER(" & Lib & ",""" & FLib & """,""" & String(NbArgs, "P") _
& """,""" & FunctionName & """,""" & Args & """," & MacroType _
& ",""" & Category & """,,,""" & Descr & """," & DescrArgs & ")"


End Sub


'=============================Â*Â*=============


Sub Auto_close()


Dim FName, FLib
Dim I As Integer
FName = Array("DIVIDE", "MULTIPLY")
FLib = Array("CharPrevA", "CharNextA")
For I = 1 To 2
With Application
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
.ExecuteExcel4Macro "REGISTER(" & Lib & _
",""CharPrevA"",""P"",""" & FName(I) & """,,0)"
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
End With
Next


End Sub


The dll solution:
Also from Laurent Longre, you use the FUNCUSTOMIZE utility .Get it at
http://longre.free.fr/english/


--
HTH


Bob Phillips

--
Gary''s Student - gsnu200907


"David" wrote:

> I'm trying to get hints/prompts to display for a UDF I've written.
>
> This group had a thread back in 2007 that had the answer, but the link
> I found is now dead. Here's the question/answer I found and the old
> link. Can anybody provide and answer or a link to the archived
> answer.
>
> TIA,
> David
>
> ------------------------------------------------------------------------------------------
> http://groups.google.com/group/micro...6f0180ce2819d5
> --
> Gary''s Student - gsnu2007a
>
>
> "michael.beckinsale" wrote:
>
> > Hi All,
> >
> > With XL2003 built in functions you get prompts for the various
> > parameters / arguments as you type into the cell.
> >
> > eg typing =Sumif( directly into a cell results in this prompt:
> >
> > SUMIF(range, criteria,[sumrange])
> >
> > Can this be achieved with UDF and if so how?
> >
> > Regards
> >
> > Michael B.
> >
> >

>
> ---------------------------------------------------------------------------------------------------------------------------
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      7th Oct 2009
Laurent Longre's link is still valid if you want to download FUNCUSTOMIZE
sdd-in.

http://longre.free.fr/english/




On Wed, 7 Oct 2009 11:23:57 -0700 (PDT), David <(E-Mail Removed)>
wrote:

>I'm trying to get hints/prompts to display for a UDF I've written.
>
>This group had a thread back in 2007 that had the answer, but the link
>I found is now dead. Here's the question/answer I found and the old
>link. Can anybody provide and answer or a link to the archived
>answer.
>
>TIA,
>David
>
>------------------------------------------------------------------------------------------
>http://groups.google.com/group/micro...6f0180ce2819d5


 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      8th Oct 2009
Depends what you mean by hints/prompts, AFAIK there is no utility out there
that will help you add tooltips or autocomplete to your UDFs.

For info and help text in the function wizard go for the link given by Gord
Dibben. If you need to include more that total 255 characters of info text,
a brilliant method is described here (not easy though)

http://www.jkp-ads.com/articles/RegisterUDF01.asp

Regards,
Peter T

"David" <(E-Mail Removed)> wrote in message
news:da7cfb91-925c-4b37-bd33-(E-Mail Removed)...
> I'm trying to get hints/prompts to display for a UDF I've written.
>
> This group had a thread back in 2007 that had the answer, but the link
> I found is now dead. Here's the question/answer I found and the old
> link. Can anybody provide and answer or a link to the archived
> answer.
>
> TIA,
> David
>
> ------------------------------------------------------------------------------------------
> http://groups.google.com/group/micro...6f0180ce2819d5
> --
> Gary''s Student - gsnu2007a
>
>
> "michael.beckinsale" wrote:
>
>> Hi All,
>>
>> With XL2003 built in functions you get prompts for the various
>> parameters / arguments as you type into the cell.
>>
>> eg typing =Sumif( directly into a cell results in this prompt:
>>
>> SUMIF(range, criteria,[sumrange])
>>
>> Can this be achieved with UDF and if so how?
>>
>> Regards
>>
>> Michael B.
>>
>>

>
> ---------------------------------------------------------------------------------------------------------------------------


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007, Query's prompts parameter twice codeSlave Microsoft Access Getting Started 2 14th Feb 2010 02:45 PM
query prompts in run-time Access 2007 Charles Microsoft Access VBA Modules 5 9th Aug 2008 04:38 PM
Powerpoint 2007 always prompts UAC Bent Microsoft Powerpoint 4 19th Jul 2008 09:15 PM
Creating a form document that prompts for entry of fields =?Utf-8?B?Q2FyZXk=?= Microsoft Word Document Management 1 2nd Feb 2007 08:11 PM
Creating message prompts =?Utf-8?B?Um9i?= Microsoft Access Forms 5 16th Jun 2006 08:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:47 PM.