Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What's the difference between 'Set UserForm1=Nothing' and 'Unload UserForm1' ? | Excel Programming | |||
When data in TextBox2 matches data in TextBox1 | Excel Programming | |||
transfering data | Excel Programming | |||
Qn: Load Data into UserForm1?? | Excel Programming | |||
UserForm1.Textbox1.SetFocus Question | Excel Programming |