A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Maybe you don't have macros enabled?
Bill Manville. Excel MVP, Oxford, England. www.manville.org.uk
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I created the following function with this code to find the first numeric charactor in a string in a cell. Cell E3 contains the string to be checked. When I enter the formula =Pos_nonalpha(E3) it returns #NAME?. What am I doing wrong?
Thanks,
JCM
Function Pos_nonalpha(cell) As Long Dim i As Long For i = 1 To Len(cell) Dim Number Select Case Asc(Mid(cell, i, 1)) Case 0 To 64, 91 To 96, 123 To 191 Pos_nonalpha = i Exit Function End Select Next i Pos_nonalpha = 0End Function
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Bill,
Sometimes the obvious is the answer. I did not realize that macros must be enabled for UDFs. Thanks all for your replies.
Much appreciated!
JCM
The presence of the Module name makes me suspect that you also have a range name Pos_nonalpha defined in the workbook.
The presence of the workbook name suggests that you are attempting to call the function from a workbook other than the one in which it is defined.??
Bill Manville. Excel MVP, Oxford, England. www.manville.org.uk