I am trying to create a simple function that returns the name of the
sheet in which the function is entered but for some reason excel
(2003) does not recognize it.
I am assuming the code is correct because I've run a variation of it
successfully as a macro. And, I even pulled some code from an
internet site that was supposed to perform the same function. Any
ideas?
Here is the code I pulled from the internet:
Function Sheetname(numWanted As Byte) As String
Select Case numWanted
Case 1
Sheetname = ActiveSheet.name
Case 2
Sheetname = ThisWorkbook.name
Case 3
Sheetname = ThisWorkbook.FullName
Case Else
Sheetname = ActiveSheet.name
End Select
End Function
Since I'm new, just wanted to say that I'm glad I found this
group. I spend a fair amount of time creating fairly complex
financial and data management models and don't work with or know
anyone who has vba experience. Hopefully, I will get some good info
from this group as well as be able to contribute to solving some of
the problems faced by other members.