I\'d like to use a formless userform so the user can navigate the excel sheet before answering the question on the userform. I need to pause or loop the code until the userform
I didn't author the following function, but I have used it for a long time and it works.
Private Function IsLoaded(ByVal formName As String) As Boolean
Dim frm As Object
For Each frm In VBA.UserForms
If frm.Name = formName Then
IsLoaded = True
Exit Function
End If
Next frm
IsLoaded = False
End Function
You will need to hardcode the string name, and not use the .Name
property of the form because the form may not be loaded yet and not contain this property.
Here is a small snippet of how you can use this function:
Do While IsLoaded("StartingSINT_Popup")
Debug.Print Time; " StartingSINT_Popup Is Loaded!"
Loop