Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Transfering Data From Userform1 to TextBox1 in UserForm2

I Have two Userforms, and i use input from the first userform to find the
information i want to be placed in the second userform (the data is in Cells
on the Active Sheet, and will be Names, or Dates). I have tried a couple
ways, and the helpsearch function doesnt really give information on this.

I figure one uses

`Get My information

Userform1.Hide

Load Userform2

With UserForm2
TextBox1=MyData
End With

UserForm2.Show

`Here is where i want my data to show in the TextBox1 of UserForm2

But when i try this, the data doesnt show on the userForm, What am i doing
wrong?

Thanks for all replies

ironhydroxide
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Transfering Data From Userform1 to TextBox1 in UserForm2

Try prefacing the TextBox'es with the UserForm's name. Using default
UserForm names...

UserForm1.TextBox1.Value = UserForm2.TextBox1.Value

or vice versa depending on which value you are assigning to which TextBox.
You don't actually need the UserForm name for the active UserForm as use it
would be the default, but it can't hurt to specify it to make things
clearer.

--
Rick (MVP - Excel)


"ironhydroxide" wrote in message
...
I Have two Userforms, and i use input from the first userform to find the
information i want to be placed in the second userform (the data is in
Cells
on the Active Sheet, and will be Names, or Dates). I have tried a couple
ways, and the helpsearch function doesnt really give information on this.

I figure one uses

`Get My information

Userform1.Hide

Load Userform2

With UserForm2
TextBox1=MyData
End With

UserForm2.Show

`Here is where i want my data to show in the TextBox1 of UserForm2

But when i try this, the data doesnt show on the userForm, What am i
doing
wrong?

Thanks for all replies

ironhydroxide


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Transfering Data From Userform1 to TextBox1 in UserForm2

Normally, I enter the data into the Sheet first.

Private Sub CommandButton1_Click()
On Error Resume Next
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Activate

Cells(1, 2) = TextBox1.Text
Cells(2, 2) = TextBox2.Text

Unload UserForm1

On Error Resume Next

UserForm2.Show
End Sub

Private Sub CommandButton2_Click()
On Error Resume Next
Sheets("Sheet1").Activate

TextBox1.Text = Format(Cells(1, 2), "#,##0.00")
TextBox2.Text = Format(Cells(2, 2), "#,##0.00")

On Error Resume Next
End Sub

Clear the used ranges, before performing additional calculations, if
necessary.

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Rick Rothstein" wrote:

Try prefacing the TextBox'es with the UserForm's name. Using default
UserForm names...

UserForm1.TextBox1.Value = UserForm2.TextBox1.Value

or vice versa depending on which value you are assigning to which TextBox.
You don't actually need the UserForm name for the active UserForm as use it
would be the default, but it can't hurt to specify it to make things
clearer.

--
Rick (MVP - Excel)


"ironhydroxide" wrote in message
...
I Have two Userforms, and i use input from the first userform to find the
information i want to be placed in the second userform (the data is in
Cells
on the Active Sheet, and will be Names, or Dates). I have tried a couple
ways, and the helpsearch function doesnt really give information on this.

I figure one uses

`Get My information

Userform1.Hide

Load Userform2

With UserForm2
TextBox1=MyData
End With

UserForm2.Show

`Here is where i want my data to show in the TextBox1 of UserForm2

But when i try this, the data doesnt show on the userForm, What am i
doing
wrong?

Thanks for all replies

ironhydroxide



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
What's the difference between 'Set UserForm1=Nothing' and 'Unload UserForm1' ? Zoo Excel Programming 1 May 11th 06 04:18 PM
When data in TextBox2 matches data in TextBox1 Maddoktor Excel Programming 3 December 21st 05 05:52 AM
transfering data pisanichris[_2_] Excel Programming 1 October 15th 05 09:18 PM
Qn: Load Data into UserForm1?? Michael Vaughan Excel Programming 2 August 19th 04 03:41 AM
UserForm1.Textbox1.SetFocus Question Zane Greer Excel Programming 1 September 14th 03 11:59 AM


All times are GMT +1. The time now is 01:11 PM.

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

About Us

"It's about Microsoft Excel"