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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top