简体   繁体   English

如何使用vlookup函数将单元格值用作另一个工作簿中的工作表名称?

[英]How to use cell value as worksheet name in another workbook using the vlookup function?

I have two separate workbooks, one called Form.xlsx and one called Database.xlsx . 我有两本单独的工作簿,一本叫做Form.xlsx ,另一本叫做Database.xlsx While in Form.xlsx the user will select a value from a dropdown in cell C3. Form.xlsx中 ,用户将从单元格C3的下拉列表中选择一个值。 I would like for the value to then be used as the Worksheet name in the Database.xlsx workbook. 我希望将该值用作Database.xlsx工作簿中的工作表名称。

For Example: 例如:

The C3 drop down list will be: C3下拉列表将为:

  • Florida 佛罗里达
  • Ohio 俄亥俄
  • Indiana 印第安那州

When a user selects say Florida from the dropdown, I would then like for that value to be plugged into a vlookup statement as the worksheet name like: 当用户从下拉列表中选择说佛罗里达时 ,我希望将该值作为工作表名称插入vlookup语句中,例如:

=vlookup(C3,'C:\\Users\\Williasa\\[Database.xlsx]Florida!$B$4:$F$6,5,FALSE)

Is there any way that I can do that? 有什么办法可以做到吗? If possible I would like to stay away from a INDIRECT statement since the Database.xlsx workbook will not be open when users are using the Form.xlsx.strong text 如果可能的话,我想避免使用INDIRECT语句,因为当用户使用Form.xlsx.strong文本时,Database.xlsx工作簿不会打开

EDIT 编辑

I feel like I need to clarify something here. 我觉得我需要在这里澄清一些事情。

On the Form is another drop-down criteria with 3 options in it in cell B14 : 表格上的另一个下拉条件在单元格B14中具有3个选项:

  • Fax 传真
  • Email 电子邮件
  • Phone 电话

I would like the vlookup to first take me to the correct worksheet defined by cell C3 (Florida, Ohio, or Indiana), search A7:A9 for the B14 drop-down value that matches, then bring in the cell value of B7:B9 to the original cell where I am running this formula. 我希望vlookup首先将我带到单元格C3 (佛罗里达,俄亥俄州或印第安纳州)定义的正确工作表,在A7:A9中搜索匹配的B14下拉值,然后输入B7:B9的单元格值到我运行此公式的原始单元格。

I apologize if I am using incorrect wording, trying my best to explain it! 如果使用不正确的措词,我们深表歉意!

If the drop-down list is small and constant or changes rarely, you could do something like: 如果下拉列表很小且恒定,或者很少更改,则可以执行以下操作:

CHOOSE(X,'C:\Users\Williasa\[Database.xlsx]Florida'!$B$4:$F$6, 'C:\Users\Williasa\[Database.xlsx]Ohio'!$B$4:$F$6, 'C:\Users\Williasa\[Database.xlsx]Indiana'!$B$4:$F$6)

Where X is a formula equal to the index of the dropdown choice (so 1 for Florida). 其中X是等于下拉选项的索引的公式(对于Florida,则为1)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过单元格值在VLOOKUP中使用名称 - How to use name in VLOOKUP from a cell value 如何将单元格值复制并粘贴到同一工作簿中的另一个工作表 - How to copy and paste a cell value to another worksheet in the same workbook 使用SUMIF函数时,如何在同一工作簿中的另一个工作表中引用另一个单元格作为通配符? - How to reference another cell as a wildcard from a separate worksheet, within the same workbook, when using SUMIF function? 如何在单元格中返回工作表或工作簿名称 - How to return worksheet or workbook name in cell 如何在另一个工作簿中引用最右侧的工作表,用于 VLOOKUP? - How to reference the far right worksheet in another workbook, for a VLOOKUP? VLookUp值到另一个工作表 - VLookUp value to another worksheet 使用单元格引用作为工作簿和工作表的名称来激活Excel工作簿/工作表 - Activating Excel Workbook/Sheet using cell reference as name of Workbook and Worksheet 使用单元格值作为工作表名称 - Use a Cell Value as a Worksheet Name 将基于单元格值的工作表移动到另一个工作簿 - Move Worksheet based off a cell value to another workbook 如何使用excel中的超链接链接到python中同一工作簿中的另一个工作表单元格 - How to use hyperlink in excel to link to another worksheet cell in same workbook in python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM