从 Excel 中选定的选项卡中选择数据 [英] pick data from a chosen tab in excel

查看:18
本文介绍了从 Excel 中选定的选项卡中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题.我有一个包含许多选项卡的文件.每个标签的名称是一个国家,标签中有关于该国家的各种数据.我想创建一个界面选项卡,用户可以在其中将国家名称放在一个单元格中(例如法国"单元格 A1),将数据项放在另一个单元格中(例如出生"),界面将给出时间序列数据项(在我的示例中为出生").有没有办法使用 Excel 而不是 VBA 来做到这一点?我可以用 VBA 做到这一点,但我需要一种仅限 Excel 的方法来做到这一点.提前致谢.

I have the following problem. I have a file with many tabs. the name of each tab is a country and in the tab there are various data about the country. I would like to create an interface tab, where the user can put the country name in a cell (eg "France" cell A1), the data item in another cell (eg "Births") and the interface will give the time series of the data item ("Births" in my example). Is there a way to do it using Excel and not VBA? I can do it with VBA, but I need an Excel-only way to do it. Thanks in advance.

推荐答案

如果 France 在 A1 中,Births 在 A2 中,您将需要一个命名范围,其工作表范围在 France 工作表上称为 Births.然后你可以使用INDIRECT函数 将地址拼凑在一起.

With France in A1 and Births in A2, you would need a named range with worksheet scope called Births on the France worksheet. Then you can use the INDIRECT function to piece the address together.

=indirect("'" & a1 & "'!" & a2)

但您可能不想为每个工作表创建所有这些命名范围.您必须在每个工作表上更好地描述您的数据布局以获得更具体的帮助.

But you probably do not want to make all of those named ranges for every worksheet. You will have to provide a better description of your data layout on each worksheet for more specific assistance.

这篇关于从 Excel 中选定的选项卡中选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆