ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populate Cell with Content of Text Box (https://www.excelbanter.com/excel-programming/433086-populate-cell-content-text-box.html)

Joyce

Populate Cell with Content of Text Box
 
I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!

Jacob Skaria

Populate Cell with Content of Text Box
 
---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Joyce

Populate Cell with Content of Text Box
 
Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Jacob Skaria

Populate Cell with Content of Text Box
 
Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Joyce

Populate Cell with Content of Text Box
 
I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Jacob Skaria

Populate Cell with Content of Text Box
 
OK..Now it is clear... You can use the Linked Cell property..

Right click the TextboxPropertiesAganist the Linked cell property type in
the cell reference for both the textboxes.. eg:

Sheet1!A1

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Joyce

Populate Cell with Content of Text Box
 
Yes, this was the method I was using, but it involves linking to a cell
instead of simply populating from one text box to another.

I works reasonably well, but I don't want the users to be able to modify the
content of textbox2. However, when I disable it, it becomes gray which I
don't want. I would like the characters to remain black and readable.

If I could fix that, I'd be fine. If you know how to do so, I'd love to
hear it.

Thanks!

"Jacob Skaria" wrote:

OK..Now it is clear... You can use the Linked Cell property..

Right click the TextboxPropertiesAganist the Linked cell property type in
the cell reference for both the textboxes.. eg:

Sheet1!A1

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Jacob Skaria

Populate Cell with Content of Text Box
 
Using code ..Suppose you have textbox1 in both Sheet1 and sheet2. In Design
mode double click Sheet1 which will open up the code window for Textbox1 .
Paste the below code (which is the change event)

Any changes made to Sheet1 textbox1 will be reflected in Sheet2 textbox 1.

Private Sub TextBox1_Change()
Sheets("sHEET2").TextBox1.Text = TextBox1.Text
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Joyce

Populate Cell with Content of Text Box
 
That worked... almost :-)

The problem now is that I can change the content of textbox2, which I don't
want the users to be able to do.

Getting closer...


"Jacob Skaria" wrote:

Using code ..Suppose you have textbox1 in both Sheet1 and sheet2. In Design
mode double click Sheet1 which will open up the code window for Textbox1 .
Paste the below code (which is the change event)

Any changes made to Sheet1 textbox1 will be reflected in Sheet2 textbox 1.

Private Sub TextBox1_Change()
Sheets("sHEET2").TextBox1.Text = TextBox1.Text
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Jacob Skaria

Populate Cell with Content of Text Box
 
OK..You can double click the sheet2 textbox and paste the below one line code
under Keydown event....which disables all entries made to the textbox/.

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
KeyCode = 0
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

That worked... almost :-)

The problem now is that I can change the content of textbox2, which I don't
want the users to be able to do.

Getting closer...


"Jacob Skaria" wrote:

Using code ..Suppose you have textbox1 in both Sheet1 and sheet2. In Design
mode double click Sheet1 which will open up the code window for Textbox1 .
Paste the below code (which is the change event)

Any changes made to Sheet1 textbox1 will be reflected in Sheet2 textbox 1.

Private Sub TextBox1_Change()
Sheets("sHEET2").TextBox1.Text = TextBox1.Text
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!


Joyce

Populate Cell with Content of Text Box
 
Thank you, thank you, thank you!

I appreciate all of your assistance - this is now working like a charm!



"Jacob Skaria" wrote:

OK..You can double click the sheet2 textbox and paste the below one line code
under Keydown event....which disables all entries made to the textbox/.

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
KeyCode = 0
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

That worked... almost :-)

The problem now is that I can change the content of textbox2, which I don't
want the users to be able to do.

Getting closer...


"Jacob Skaria" wrote:

Using code ..Suppose you have textbox1 in both Sheet1 and sheet2. In Design
mode double click Sheet1 which will open up the code window for Textbox1 .
Paste the below code (which is the change event)

Any changes made to Sheet1 textbox1 will be reflected in Sheet2 textbox 1.

Private Sub TextBox1_Change()
Sheets("sHEET2").TextBox1.Text = TextBox1.Text
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I think we're having a miscommunication. I apologize. I am designing a
form-like worksheet, but haven't created an actual userform.

So, I am simply trying to populate one text box with another's content
without userforms.

I hope I'm being more clear this time.

Thanks

"Jacob Skaria" wrote:

Hope you have tried ControlSource property too....You can place the code in
Initialize event of the second form...The below code is written on userform2
initialize which will assign the textbox1 with the value in textbox1 in
userform1

Private Sub UserForm_Initialize()
Me.TextBox1 = UserForm1.TextBox2
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

Hello Jacob,

Where would I put the Me.TextBox1 = UserForm1.TextBox1.Text code?

I would ideally just like one text box to automatically contain was another
one does.

"Jacob Skaria" wrote:

---Right click the text boxes and set the ControlSource property to the cell
reference for example

Sheet1!a1


---You can directly get the textbox content from another userform
Me represent userform2

Me.TextBox1 = UserForm1.TextBox1.Text

If this post helps click Yes
---------------
Jacob Skaria


"Joyce" wrote:

I am trying to display the content of one text box on a form in another form
text box on another sheet.

I don't want the users to have to type information in a cell - justs the
initial text box.

I know I can link cell content to a text box, so I'd ideally like to have
the user input data into textbox1, have that display in a cell, then have
textbox2 link to the cell so that it populates automatically.

Any idea if this is possible? Or any better ideas?

Thanks!



All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com