Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Unloading /Closing all userforms

I've searched all over and cannot find an example of coding that will close
all open user forms. I'm thinking something like

For i = 1 To Controls("msforms").Count
Unload ?
Next

As you can see, that's a really rough estimate of what's needed.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Unloading /Closing all userforms

Dim frm As UserForm
For Each frm In UserForms
Unload frm
Next frm


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"dunnerca" wrote in message
...
I've searched all over and cannot find an example of coding that will
close
all open user forms. I'm thinking something like

For i = 1 To Controls("msforms").Count
Unload ?
Next

As you can see, that's a really rough estimate of what's needed.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Unloading /Closing all userforms

Something like this...

lngCount = UserForms.Count
If lngCount 0 Then
For N = lngCount To 1
Unload UserForms(N - 1)
Next
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"dunnerca" <
wrote in message
I've searched all over and cannot find an example of coding that will close
all open user forms. I'm thinking something like

For i = 1 To Controls("msforms").Count
Unload ?
Next

As you can see, that's a really rough estimate of what's needed.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Unloading /Closing all userforms

For Each frm In VBA.UserForms
Unload frm
Next frm

You can get the names of each of the forms using frm.name

"dunnerca" wrote:

I've searched all over and cannot find an example of coding that will close
all open user forms. I'm thinking something like

For i = 1 To Controls("msforms").Count
Unload ?
Next

As you can see, that's a really rough estimate of what's needed.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unloading userforms Oggy Excel Programming 6 May 13th 07 11:13 AM
Avoid unloading of .xla addins when closing books are cancelled. Zoo Excel Programming 4 February 21st 06 03:58 PM
Unloading / closing a form with the escape key Bettergains Excel Programming 0 January 11th 06 06:41 PM
Closing excel userforms Jim[_57_] Excel Programming 4 June 15th 05 05:27 AM
closing userforms [email protected] Excel Programming 5 May 11th 05 08:15 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"