+ Reply to Thread
Results 1 to 4 of 4

Reading data from a cell to a text box

  1. #1
    Registered User
    Join Date
    02-05-2006
    Posts
    40

    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

  2. #2
    roger nordman
    Guest

    Re: Reading data from a cell to a text box

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

    should do the trick
    /roger


  3. #3
    John
    Guest

    Re: 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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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
    >




  4. #4
    Registered User
    Join Date
    02-05-2006
    Posts
    40
    Thanks for your help guys. Worked fine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1