Thread: Userform modal
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Userform modal

Demo: Userform1 has a Textbox1. Userform2 has a Label1.

Standard module code:

Public Monitorform As UserForm2

Sub RunThis()
Dim UF1 As UserForm1
Set UF1 = New UserForm1
Set Monitorform = New UserForm2
Monitorform.StartUpPosition = 0
Monitorform.Show vbModeless
UF1.Show vbModeless
End Sub

Userform1 code:

Private Sub TextBox1_Change()
If Monitorform Is Nothing Then Exit Sub
Monitorform.Label1.Caption = TextBox1.Text
End Sub

Userform2 Code:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Set Monitorform = Nothing
End Sub


HTH. Best wishes Harald




"Dave K" wrote in message
...
I have created Userforms for timesheets with different projects appearing
on
a Multi page Userform. The problem is I need to show the subtotals on
another
Userform as the user inputs the data. i've tried everything but I can't
get
it to work