# import Excel sheets by name

I'm importing data from Excel. It appears that the sheet number needed in the Import statement is taken from the order that the sheets appear in the open Excel file. I need to import 2 of the sheets from an Excel file. I'd like to do it via the names of the sheets, or at least by some attribute that won't change if I add or delete other sheets or re-order the existing sheets. Can this be done?

-
Yes, the XLSX documentation page tells you how. –  Sjoerd C. de Vries Aug 1 '13 at 13:49
I am embarrassed. I looked again and there it was. –  Mitchell Kaplan Aug 1 '13 at 21:10

## 1 Answer

(*show all sheets*)
Import["D:\\allstuff.xls", "Sheets"]
{"portf", "notes", "calc", "xirr", "tx", "JTrade", "Yahoo"}

Import["D:\\stuff.xls", {"Sheets", "portf", 6}]
(*gets 6th row of sheet named "portf"*)


Leave off the 6 to get the whole sheet or say 6,2 to get one cell at 6,B.

-