VBA function does not show up

Sanya

New Member
Joined
Mar 4, 2015
Messages
8
Hi,
I am trying to write a new user defined function, but it doesn't show up on the list of the options when I go to cell and press "=". Maybe someone can point what the problem is. It suppose extract middle section from the Full Name (FN) text.
Thank you very much

Function AssignmentNo(FN As String)
If Mid(FN, Len(FN) - 8, 1) = "-" Then
AssignementNo = Mid(FN, Len(FN) - 16, 10)
Else
AssignementNo = Mid(FN, Len(FN) - 14, 8)
End If
End Function
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
It should be written as
Public Function...

And it needs to go in a standard module (Insert - New Module).
NOT in a sheet module.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,542
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top