Changing sheet codename Run-Time Error 9: Subscript out of range

前端 未结 4 1119
死守一世寂寞
死守一世寂寞 2021-01-12 02:19

I\'ve code which, when I press a button, will add a new sheet to a workbook and change the codename of the sheet to make it easier to refer to later in my code.



        
4条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 03:08

    A general approach to solve such VBComponent-dependent code problems is to use the VbeInit procedure given here that is flexible to be called multiple times for each newly opened workbook that may not yet be "VBComponent-initialized".

提交回复
热议问题