VBA用户形式为函数的变量
我有以下问题:我有一个用户形式菜单,从那里可以导航到其他页面,我想创建一个“返回按钮”以供每个页面返回菜单。
我尝试创建这个:
Private Sub btnback_Click()
Call back_menu(Actions)
End Sub
Sub back_menu(stage) 'Tried: stage As Object
Unload stage
Menu.Show
End Sub
另一个示例:
Sub next_page(from,to)
Unload from
to.show
这个第一现在正在工作,但是每次关闭用户形式时,我都会收到一个错误:
run-type error'13' 输入MISSMATCH
我知道我可以一个一个一个,也可以我们卸载我,但是我还有其他功能,我想使用此方法调用正确的用户形式。
提前致谢
I have the following problem: I have a userform menu, from there I can navigate to other pages, and I want to create a "back button" for each page to return to the menu.
I tried to create this:
Private Sub btnback_Click()
Call back_menu(Actions)
End Sub
Sub back_menu(stage) 'Tried: stage As Object
Unload stage
Menu.Show
End Sub
Another example:
Sub next_page(from,to)
Unload from
to.show
This 1st is working now, but everytime I close the userform i got an error:
Run-type error'13'
Type missmatch
I know I could write one by one or I could us the Unload Me, but I have other Functions where I would like to use this method to call the right userform.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
hide
用户形式的方法避免避免使用代码单词的可变名称 - >像
to
在中为i = 1至10
。Try using the
hide
method of the userformYou shoud avoid variable names that are code words as well --> like
to
inFor i = 1 to 10
.