Thread: User forms
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default User forms

Here is a very simple example of what you ask.

I have 2 userforms with a textbox on each. On the first I also have a
button, and this code, on a button press, will copy the contents of the
textbox on form1 to the textbox on form2, and then show form2. All in the
userform code module

Private Sub CommandButton1_Click()
UserForm2.TextBox1.Text = Me.TextBox1.Text
UserForm2.Show
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"eklarsen " wrote in message
...
I posted a bit of code in a previous post and got no replies so I
thought I would ask a simpler question.
Is it possible to have a user enter data on one user form and using
that data return the answer (calculated) to another user form that is
called when the user presses an action button?
Will this code need to be in a Module or is it ok to leave it in the
private Sub in the Userform.

Is it possible to call data from userform1 to userform2 if the code is
not in a module?

Sorry if this seem's simple but I am very new to VBA.
Thanks for taking the time.


---
Message posted from http://www.ExcelForum.com/