Excel VBA隐藏所有打开的用户表单 [英] Excel VBA Hide all opened userforms
问题描述
是否有一个电话可以隐藏所有当前打开的可见表单。或者,循环所有当前打开的表单(例如内存中的表单)请求一个显然是我的懒惰。请求两个将足够,因为我可以在之后隐藏他们的代码。
对于潜在的Google搜索
这是我需要的答案。这将隐藏任何打开的用户形式。
Dim UForm As Object
对于VBA.UserForms中的每个UForm
如果UForm.Visible = True然后
UForm.Hide
结束如果
下一个
I have a medical userform that a clinician will be using. There are several buttons to allow them to navigate to different forms. I'm currently using a Sub that does several checks to see if the forms are visible and if so, don't be. But that's not very friendly for adaptation.
Is there a call I can make to hide all currently open visible forms. Or, cycle through all currently opened forms (eg ones in memory) Request one is obviously the lazy one for me. Request two will be sufficient as I can do the code to hide them after that.
For potential google searches
This was the answer I needed. This will hide any open userforms.
Dim UForm As Object
For Each UForm In VBA.UserForms
If UForm.Visible = True Then
UForm.Hide
End If
Next
这篇关于Excel VBA隐藏所有打开的用户表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!