Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I compose a function in VBA and refer to it in a
formula? Let's say A1 has the text: "aja,ajsd," and I want to use a formula to call the function I've created: =ParseComma(A1) or perhaps qualifying it more? =Module1.ParseComma(A1) to return "ajaajsd" to the field? If I can't, why not? Can Add-ins do it? Thanks for the info. -Brad PS: I'm not interested in a solution to parse a comma, but thanks. :) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes you can do exactly what you have described.
Did you try it and get a problem then ? By the way, an add-in is just another workbook where there are no visible worksheets, it can have functions subs and even data as any other worksheet. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Brad" wrote in message ... Can I compose a function in VBA and refer to it in a formula? Let's say A1 has the text: "aja,ajsd," and I want to use a formula to call the function I've created: =ParseComma(A1) or perhaps qualifying it more? =Module1.ParseComma(A1) to return "ajaajsd" to the field? If I can't, why not? Can Add-ins do it? Thanks for the info. -Brad PS: I'm not interested in a solution to parse a comma, but thanks. :) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sure. Open VB editor (Alt F11 or similar). menu Insert Module. Then type something like
Function RemoveStuff(FromWhat As String, _ RemoveWhat As String) As String RemoveStuff = Replace$(FromWhat, RemoveWhat, "") End Function (Note all the declarations, here all As String) Then return to a worksheet. In A1 type ABCD. In B1 type =RemoveStuff(A1,"C") You'll also find it under Insert Function category Custom or User Defined. -- HTH. Best wishes Harald Followup to newsgroup only please. "Brad" wrote in message ... Can I compose a function in VBA and refer to it in a formula? Let's say A1 has the text: "aja,ajsd," and I want to use a formula to call the function I've created: =ParseComma(A1) or perhaps qualifying it more? =Module1.ParseComma(A1) to return "ajaajsd" to the field? If I can't, why not? Can Add-ins do it? Thanks for the info. -Brad PS: I'm not interested in a solution to parse a comma, but thanks. :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User defined functions without using VBA. | Excel Worksheet Functions | |||
User defined functions without using VBA. | Excel Worksheet Functions | |||
User Defined Functions | Excel Worksheet Functions | |||
User defined worksheet functions | Excel Programming | |||
User Defined Functions | Excel Programming |