1. 顽石财经首页
  2. 专题归档

VBA窗体停留在Sheet1切换到Sheet2不会显示

'放置位置:ThisWorkBook
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.Name = "Sheet1" Then UserForm1.Show 0 Else UserForm1.Hide
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
    If Wn.ActiveSheet.Name = "Sheet1" Then UserForm1.Show 0 Else UserForm1.Hide
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
    UserForm1.Hide
End Sub

本文来自用户投稿,不代表顽石财经立场;如侵犯了您的权益,请与本站联系;如若转载,请注明出处:https://www.rocknod.com/1362.html

发表评论

登录后才能评论
QR code