Thread: sheet names
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default sheet names

Here's a little UDF to do it

Public Function Findit(idx As Long)
Findit = Application.Caller.Parent.Parent.Sheets(idx).Name
End Function


if you want to call it from VBA, use this

Public Function Findit(idx As Long, Optional wb)
If IsMissing(wb) Then
Set wb = ThisWorkbook
End If
Findit = wb.Sheets(idx).Name
End Function


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Max" wrote in message
...
"John" wrote:
I am writing macros. I have about 150-200 sheets. I want to either find
something or insert something by sheet name in several of my programs.
Apparently there's no way to do it in existing excel functions. It would
seem fundemental to me to be able to find out the name of, say, sheet 42
in my program.


Perhaps you should have mentioned this in your original post. Perhaps you
should have posted in .programming, instead of here, in .newusers (if it's

a
vba question, you're hardly a "new user").

Hang around awhile for possible insights from other responders versed in
vba. If none drops by, suggest you put in a fresh post in .programming.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---