![]() |
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 |
Reading data from a cell to a text box
Userform.txtDiameter.Caption = Cells(2, 3).Value
should do the trick /roger |
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 |
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