ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Multiple User Forms to pass info from one to the other (https://www.excelbanter.com/excel-programming/318904-using-multiple-user-forms-pass-info-one-other.html)

Neal

Using Multiple User Forms to pass info from one to the other
 
Dear Experts,

I have set up one userform and when one of the buttons is clicked, a second
userform is shown. How can I have information input by the user in the
second userform that can be transferred to the first userform? Thanks in
advance.

Neal

Harald Staff

Using Multiple User Forms to pass info from one to the other
 
Hi Neal

There are many ways to do that. Here is one of them. Userform2 code:

Option Explicit

Public MyMessage As String

Private Sub UserForm_Activate()
Me.Caption = MyMessage
End Sub

Userform1 button code:

Private Sub CommandButton1_Click()
UserForm2.MyMessage = "Yo!"
Unload Me
UserForm2.Show
End Sub

HTH. Best wishes Harald
"Neal" skrev i melding
...
Dear Experts,

I have set up one userform and when one of the buttons is clicked, a

second
userform is shown. How can I have information input by the user in the
second userform that can be transferred to the first userform? Thanks in
advance.

Neal




Neal

Using Multiple User Forms to pass info from one to the other
 
Dear Harald,

Thanks for your help. This is exactly what I need.

"Harald Staff" wrote:

Hi Neal

There are many ways to do that. Here is one of them. Userform2 code:

Option Explicit

Public MyMessage As String

Private Sub UserForm_Activate()
Me.Caption = MyMessage
End Sub

Userform1 button code:

Private Sub CommandButton1_Click()
UserForm2.MyMessage = "Yo!"
Unload Me
UserForm2.Show
End Sub

HTH. Best wishes Harald
"Neal" skrev i melding
...
Dear Experts,

I have set up one userform and when one of the buttons is clicked, a

second
userform is shown. How can I have information input by the user in the
second userform that can be transferred to the first userform? Thanks in
advance.

Neal






All times are GMT +1. The time now is 06:50 AM.

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