如何创建一个动态的工作表名称下拉菜单?

huangapple go评论63阅读模式
英文:

How to create a dynamic dropdown of sheet names?

问题

我需要创建一个动态的工作表名称下拉列表,但不使用VBA或Excel 4.0宏。

我想要一个工作表名称的下拉列表,它会在有人向工作簿的相关部分添加工作表或更改这些工作表的名称时进行更新。新的工作表只是通过复制模板工作表来添加的。

我不能使用Excel 4.0宏,因为信任中心会在每次新的用户打开共享工作簿时重置,不允许宏运行,我不希望客户不断重置信任中心。我在论坛上没有找到不使用VBA或4.0宏的解决方案。

我尝试了这个公式=SUBSTITUTE(GET.WORKBOOK(1), "[ " & GET.WORKBOOK(16) & "]", "")

只要启用Excel 4.0宏,这个方法就能正常工作,但是信任中心会在每次新用户打开共享工作簿时阻止它们的运行。

英文:

I need to create a dynamic dropdown of sheet names without using VBA or Excel 4.0 macros.

I want to have a dropdown of sheet names which updates any time someone adds a sheet into the relevant section of the workbook, or changes the name of any of these sheets. The new sheets are only added in by copying a template sheet.

I can't use Excel 4.0 macros because Trust Centre is resetting so as not to allow them, every time a new person opens the shared workbook, and I don't want my client to have to keep resetting Trust Centre. I couldn't find a solution searching the forums that didn't use VBA or 4.0 macros.

I tried the formula =SUBSTITUTE(GET.WORKBOOK(1),"["&GET.WORKBOOK(16)&"]","")

This worked fine as long as Excel 4.0 macros were enabled but Trust Centre kept blocking them every time a new person opened the shared workbook.

答案1

得分: 1

I found an answer to this that works in Microsoft 365.

我找到了一个在Microsoft 365中有效的解决方法。

I used this formula from elsewhere on the forum in cell B1 on all the sheets in the range so that each sheet would have its own name on it in the same location:

我在范围内的所有工作表的单元格B1中使用了来自论坛其他地方的这个公式,以便每个工作表都在相同位置具有自己的名称:

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

=中间(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

Then on a separate sheet I used this formula to create the dropdown list for data validation:

然后在一个单独的工作表上,我使用了这个公式来创建数据验证的下拉列表:

=TEXTSPLIT(TEXTJOIN(", ",TRUE,'StartSheet:EndSheet'!$B$1),,", ",TRUE,0)

=TEXTSPLIT(TEXTJOIN(", ",TRUE,'StartSheet:EndSheet'!$B$1),,", ",TRUE,0)

英文:

I found an answer to this that works in Microsoft 365.

I used this formula from elsewhere on the forum in cell B1 on all the sheets in the range so that each sheet would have its own name on it in the same location:

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

Then on a separate sheet I used this formula to create the dropdown list for data validation:

=TEXTSPLIT(TEXTJOIN(", ",TRUE,'StartSheet:EndSheet'!$B$1),,", ",TRUE,0)

huangapple
  • 本文由 发表于 2023年4月7日 00:19:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951663.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定