Sorry for the similar two responses already to your question. The first time
I got an error and thought the response did not go through.
Here is anothe way that I found one can iterate
Dim uf As Object
For Each uf In UserForms
Debug.Print uf.Caption
Next uf
This is taken from Chip Pearson's explanation.
http://groups.google.com/group/micro...3e7c01 a6ff7f
"Nigel RS" wrote:
Hi All
I am trying to list all userform controls. Part of this process requires
that I also show the userform name and caption.
In testing I discover an anomoly, that I cannot resolve - the first test
below works and correctly prints the userform name and caption. the second
does not work - can someone explain why please?
' this works
Debug.Print ufReport.Name, ufReport.Caption
' this does not work?
Dim uf As UserForm
Load ufReport
For Each uf In UserForms
Debug.Print uf.Name, uf.Caption
Next
Unload ufReport