Reading data from a cell to a text box

  • Thread starter Thread starter Aaron1978
  • Start date Start date
A

Aaron1978

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
 
Userform.txtDiameter.Caption = Cells(2, 3).Value

should do the trick
/roger
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top