Excel 2013 worksheet activate

前端 未结 9 1819
情话喂你
情话喂你 2021-01-03 03:28

I have an issue with activating a sheet from a user form, the same code works fine in Excel 2003 to Excel 2010, doesn\'t work with Excel 2013.

This is how to simply

9条回答
  •  长情又很酷
    2021-01-03 03:38

    Please avoid using .SELECT. You may want to see THIS?

    Having said that, if you really want to activate the sheet then use .ACTIVATE

    For example

    Sheets("Sheet2").Activate
    

    So using that in your code, it will look like this.

    Sub Macro1()
        Sheets("Sheet2").Activate
    End Sub
    
    Sub Macro2()
        Macro1
        Unload Me
    End Sub
    

提交回复
热议问题