ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to use a UDF (module) across many users (embedd in worsheet) (https://www.excelbanter.com/excel-worksheet-functions/162564-how-use-udf-module-across-many-users-embedd-worsheet.html)

GRIFFO

How to use a UDF (module) across many users (embedd in worsheet)
 
Hi, I am using a UDF to strip non numeric text out of a cell.

That is:

Function StripTxt(a As String) As String
' Strips all non-numeric characters from a string
' Returns a string, not a number!
Dim i As Long
Dim b As String
For i = 1 To Len(a)
b = Mid$(a, i, 1)
If Asc(b) 47 And Asc(b) < 58 Then StripTxt = StripTxt + b
Next i
End Function

My questions is, when someone other than me opens this workbook, it
references their local C Drive profile for the location of the xla file. Is
there a way such that I can embedd this UDF in the workbook itself, such that
it doesn't have to reference an external file?

That is, I want the code related to stripping the text, to remain in the
workbook, so that another user other than the one that created the function
can use it.

Any assistance would be appreciated.

John


GRIFFO

How to use a UDF (module) across many users (embedd in worsheet)
 
It's all good. For some reason the module was saved to a temporary file of
some sort. re did the process and now all is good.
:)

--
Your assistance is appreciated.
Griffo



"GRIFFO" wrote:

Hi, I am using a UDF to strip non numeric text out of a cell.

That is:

Function StripTxt(a As String) As String
' Strips all non-numeric characters from a string
' Returns a string, not a number!
Dim i As Long
Dim b As String
For i = 1 To Len(a)
b = Mid$(a, i, 1)
If Asc(b) 47 And Asc(b) < 58 Then StripTxt = StripTxt + b
Next i
End Function

My questions is, when someone other than me opens this workbook, it
references their local C Drive profile for the location of the xla file. Is
there a way such that I can embedd this UDF in the workbook itself, such that
it doesn't have to reference an external file?

That is, I want the code related to stripping the text, to remain in the
workbook, so that another user other than the one that created the function
can use it.

Any assistance would be appreciated.

John



All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com