ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Display many instances of the same form (https://www.excelbanter.com/excel-programming/278875-display-many-instances-same-form.html)

Warrio

Display many instances of the same form
 
Hello



Is it possible to show many instances a form many times?



If the form is already displayed once, and I try to do (Form.Show) one more
time, an error message appears and tells that I can't display it twice.



Thanks for any suggestion



Tom Ogilvy

Display many instances of the same form
 
Sub Tester2()
Set frm1 = New UserForm1
frm1.Show vbModeless
Set frm2 = New UserForm1
frm2.Show vbModeless

End Sub

You will need to move them around to see them.

--
Regards,
Tom Ogilvy



"Warrio" wrote in message
...
Hello



Is it possible to show many instances a form many times?



If the form is already displayed once, and I try to do (Form.Show) one

more
time, an error message appears and tells that I can't display it twice.



Thanks for any suggestion





keepITcool

Display many instances of the same form
 

The forms MUST be modeless. (thus cant do this in Excel97)

In the code for the form make sure you dont the the form's name but (if
needed) refer to Me.ComboBox1 .etc..


Sub TenForms()
Dim myforms(0 To 9) As UserForm1
Dim i
For i = 0 To 9
Set myforms(i) = New UserForm1
With myforms(i)
.Show vbModeless
.Top = i * 10
.Left = i * 10
.Caption = "Myform" & i
End With
Next
End Sub




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Warrio" wrote:

Hello



Is it possible to show many instances a form many times?



If the form is already displayed once, and I try to do (Form.Show) one
more time, an error message appears and tells that I can't display it
twice.



Thanks for any suggestion





Warrio

Display many instances of the same form
 
Thanks a lot!!


"Warrio" a écrit dans le message de
...
Hello



Is it possible to show many instances a form many times?



If the form is already displayed once, and I try to do (Form.Show) one

more
time, an error message appears and tells that I can't display it twice.



Thanks for any suggestion






All times are GMT +1. The time now is 07:29 PM.

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