ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Userform modal (https://www.excelbanter.com/excel-discussion-misc-queries/261067-userform-modal.html)

Dave K[_3_]

Userform modal
 
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

Harald Staff[_2_]

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




All times are GMT +1. The time now is 07:54 AM.

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