vba 如何在excel表中引入用户表单?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13115546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to bring the userform in the excel sheet?
提问by user441978
回答by brettdj
To hide the Excel Application but show a UserFrom you could use this in the ThisWorkbook
module
要隐藏 Excel 应用程序但显示 UserFrom,您可以在ThisWorkbook
模块中使用它
Private Sub Workbook_Open()
Application.WindowState = xlMinimized
UserForm1.Show vbModeless
End Sub
回答by Daniel
To open when you open the workbook in the ThisWorkbook Module:
在 ThisWorkbook 模块中打开工作簿时打开:
Private Sub Workbook_Open()
Userform1.Show
End Sub
Replace UserForm1 with the name of the Userform, if different.
将 UserForm1 替换为用户窗体的名称(如果不同)。
To open when you enter a particular sheet in the sheet Module:
在工作表模块中输入特定工作表时打开:
Private Sub Worksheet_Activate()
UserForm1.Show
End Sub