View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KJTFS[_23_] KJTFS[_23_] is offline
external usenet poster
 
Posts: 1
Default Is it possible to call a UserForm multiple times?

Yes but you have to create them as new objects like this.

Dim xlFrm As frmNew '' or whatever you named it.
Set xlFrm = New frmNew1

xlFrm.Caption = "TEST"
xlFrm.Show vbmodaless


That will let you create a bunch of them but closing them is a little
harder you will need some type of unique identifier on all of them then
loop thru all forms to find the one that needs to be closed and then
hide or unload it.

Something like

For i = 0 to UserForms.count -1

if userforms(i)."what ever you use to hold ID" = "what you are looking
for.."
userforms(i).hide
endif


next i

Keith
www.kjtfs.com


---
Message posted from http://www.ExcelForum.com/