仅打印工作簿中的所有电子表格名称
是否可以仅打印电子表格名称(选项卡底部的名称)? 我有一本工作簿,里面有很多电子表格(超过 500 个,呃,这是一个音乐目录……CD,里面有什么,作曲家,指挥家,乐章,时间等),我想打印出来工作簿的名称,而不是全部和每个部分的名称。 是的,我知道我很可能应该在 Access 中执行此操作,但 64 年前我在 Commidore 上开始使用它,并且一直在“转换”它。 最新版本是 Excel 2007。因此本质上它是使用电子表格完成的“2D 数据库”,而不是在 Access 中完成的“3D 数据库”。 许多问候。
Is it possible to print ONLY the spreadsheets names (the names at the bottom on the tabs)?
I have a workbook with quite a lot of spreasheets (over 500, er, it's a catalogue of music... CDs, what's on them, composors, conductors, movements, times etc.) and would like to do a print out of just the names of, not all and every part of the workbook.
Yes I know I should more than likely do this in Access, but I started it on a Commidore 64 years ago and have just been 'converting' it as I go along. Latest version is in Excel 2007. So esentially it's a '2D database' done using spreadsheets, rather than a '3D database' done in Access.
Many regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 VBA,您可以非常轻松地将工作表名称列表转储到工作簿中的新工作表中。
转到任何空白工作表,然后运行此宏。 它将输出第一列中的所有工作表名称。 然后您只需打印该列表即可。
Using VBA you can pretty easily dump the list of sheet names to a new sheet in your workbook.
Go to any blank worksheet, and then run this macro. It will output all the worksheet names in the first column. You can then just print the list.
假设您使用 VBA 而不是 .NET,您可以编写与此类似的子例程。 .NET 中提供了相同的对象和名称。
Assuming you using VBA and not .NET you could write a sub routine similar to this. The same objects and names are available in .NET.
您可以使用 Perl 和 Spreadsheet::ParseExcel 模块已安装。
You can do this using Perl with Spreadsheet::ParseExcel module installed.
您可以创建一个 OleDbConnection 到 Excel 工作簿,然后调用 GetOleDbSchemaTable 来获取所有表的列表,这些表只不过是 Excel 工作表列表
ExcelConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null , “桌子” });
You can make a OleDbConnection to your Excel workbook then call GetOleDbSchemaTable to get list of all tables which are nothing but list of excel sheets
ExcelConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
您可以使用安装了 xlrd 模块的 Python 来执行此操作
:
on_demand
arg 是 0.7.1 版本中的新增内容; 它无需预先解析所有工作表,从而节省时间和内存。 如果您有早期版本,请升级或删除上面代码段中的on_demand=True
。You can do this using Python with the xlrd module installed:
Note: the
on_demand
arg is new in version 0.7.1; it allows saving time and memory by not parsing all the worksheets up front. If you have an earlier version, either upgrade or removeon_demand=True
in the snippet above.