How can I get worksheets' names in spreadsheet

G

Guest

As you know, a excel spreadsheet workbook can contains some worksheets and
each worksheet has its names, my problem is how to get these names. Who can
Help me ?
Any help will be very very appreciated!
 
G

Guest

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

The above pasted into any cell on a worksheet will return the name of that
sheet. If you want the names of all sheets on one sheet then this can be
pasted into the indivdual sheets and referenced on the summary sheet
 
G

Guest

first and foremost, thank you for your advise!

The spreadsheet I said is a kind of COM for Csharp.NET.
It can drog on the winform to work for users as excel.
my problem is how to get the name of each worksheet using C# language.
I do not know the type of "ws" which mentioned in your answer!
Thanks again.



--
marxi


Mike said:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

The above pasted into any cell on a worksheet will return the name of that
sheet. If you want the names of all sheets on one sheet then this can be
pasted into the indivdual sheets and referenced on the summary sheet

marxi said:
As you know, a excel spreadsheet workbook can contains some worksheets and
each worksheet has its names, my problem is how to get these names. Who can
Help me ?
Any help will be very very appreciated!
 
A

Arvi Laanemets

Hi

Public Function TabI(TabIndex As Integer, Optional MyTime As Date) As String
TabI = Sheets(TabIndex).Name
End Function


In a column, you use this UDF to return 1st, 2nd, etc sheet name - like this

A1=IF(ISERROR(TABI(ROW(),NOW())),"",TABI(ROW()))
(and copy down)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top