ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading data from a cell to a text box (https://www.excelbanter.com/excel-programming/355315-reading-data-cell-text-box.html)

Aaron1978[_9_]

Reading data from a cell to a text box
 

Hi All,

I have a user form with a number of text boxes. How do you read data
from a cell in a workbook to the text box in the user form? The text
box is called txtDiameter and I assumed the code would be quite simple
and tried the following:

txtDiameter = Cells(2, 3).Value

txtDiameter on the user form remins blank. Does any body have any
ideas?

Best Regards,

Aaron


--
Aaron1978
------------------------------------------------------------------------
Aaron1978's Profile: http://www.excelforum.com/member.php...o&userid=31201
View this thread: http://www.excelforum.com/showthread...hreadid=519726


roger nordman

Reading data from a cell to a text box
 
Userform.txtDiameter.Caption = Cells(2, 3).Value

should do the trick
/roger


John[_88_]

Reading data from a cell to a text box
 
Hi Aaron,

You've got the reference to the object (txtDiameter). You just need to set
its 'Value' property, so:

txtDiameter.Value = Cells(2, 3).Value

Best regards

John


"Aaron1978" wrote
in message ...

Hi All,

I have a user form with a number of text boxes. How do you read data
from a cell in a workbook to the text box in the user form? The text
box is called txtDiameter and I assumed the code would be quite simple
and tried the following:

txtDiameter = Cells(2, 3).Value

txtDiameter on the user form remins blank. Does any body have any
ideas?

Best Regards,

Aaron


--
Aaron1978
------------------------------------------------------------------------
Aaron1978's Profile:
http://www.excelforum.com/member.php...o&userid=31201
View this thread: http://www.excelforum.com/showthread...hreadid=519726




Aaron1978[_10_]

Reading data from a cell to a text box
 

Thanks for your help guys. Worked fine.


--
Aaron1978
------------------------------------------------------------------------
Aaron1978's Profile: http://www.excelforum.com/member.php...o&userid=31201
View this thread: http://www.excelforum.com/showthread...hreadid=519726



All times are GMT +1. The time now is 12:17 AM.

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