ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forms.Close (https://www.excelbanter.com/excel-programming/273949-forms-close.html)

Robin

Forms.Close
 
I have a macro with a number of userforms, I want to be
able to close them all at once as sometimes multiple
copies of the same form lie under the topmost one. VBE
help says I can use

Sub CloseForm()
Forms("MyForm.frm").Close
End Sub

or

Sub CloseAll()
Forms.Close
End Sub

I tried using these in a Public Sub placed in a module and
called from a command button on each form. However, I get
this error message.

Sub, Function, or Property not defined (Error 35)

Any ideas why?


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com