Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default User Defined Worksheet Functions?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default User Defined Worksheet Functions?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default User Defined Worksheet Functions?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
User defined functions without using VBA. [email protected] Excel Worksheet Functions 0 June 13th 06 05:49 PM
User defined functions without using VBA. [email protected] Excel Worksheet Functions 0 June 13th 06 05:44 PM
User Defined Functions Jeff B Excel Worksheet Functions 1 April 27th 05 09:59 PM
User defined worksheet functions kevin[_2_] Excel Programming 1 September 4th 03 09:08 PM
User Defined Functions Tom Waters Excel Programming 1 July 21st 03 12:00 PM


All times are GMT +1. The time now is 02:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"