Rename Worksheet Event in Excel

后端 未结 5 410
既然无缘
既然无缘 2020-12-09 12:15

What is the best way to get some VBA code to run when a excel sheet is renamed?

5条回答
  •  北海茫月
    2020-12-09 12:39

    I'm eagerly awaiting an answer to this because I haven't figured it out after much searching. There is no rename event on a worksheet that I have found, so you are forced to have an alternative approach.

    The best one I have seen (which is awful) is to prohibit rename on the sheets by making them read-only or invisible, and then provide your own toolbar or button that does the rename. Very ugly and users hate it.

    I have also seen applications that disable the rename menu item in the office toolbar, but that doesn't prevent double-clicking the tab and renaming there. Also very ugly and users hate it.

    Good luck, I hope someone comes up with a better answer.

提交回复
热议问题