#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User forms

I posted a bit of code in a previous post and got no replies so
thought I would ask a simpler question.
Is it possible to have a user enter data on one user form and usin
that data return the answer (calculated) to another user form that i
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 th
private Sub in the Userform.

Is it possible to call data from userform1 to userform2 if the code i
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User forms

Thanks Bob, it worked like a champ

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
user forms Obi-Wan Kenobi Excel Discussion (Misc queries) 0 March 21st 06 08:28 PM
User Forms Runner77 Excel Discussion (Misc queries) 1 January 12th 06 06:20 AM
user forms Runner77 Excel Discussion (Misc queries) 0 January 12th 06 04:31 AM
User Forms Sgwapt Excel Programming 0 January 17th 04 01:22 AM
VB user forms Madasu Excel Programming 4 January 11th 04 10:47 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"