+ Reply to Thread
Results 1 to 3 of 3

Read from text field

  1. #1
    april27
    Guest

    Read from text field

    Hi I have a user form that opens when the workbook is opened. In this user
    form I have text fields in which the user shall submitt info. How do I get my
    macro to "read" the text submitted into the text field after a button on the
    user form is pressed?

  2. #2
    Bernie Deitrick
    Guest

    Re: Read from text field

    You do that by reading the text or caption property of the objects on the
    userform. The specific code depends on your setup, but in general something
    like this in the commandbutton click event, with myVar1,2 &3 being declared
    public variables...

    myVar1 = Userfrom1.Textbox1.Text
    myVar2 = Userfrom1.Textbox2.Text
    myVar3 = Userfrom1.Textbox3.Text

    HTH,
    Bernie
    MS Excel MVP

    "april27" <[email protected]> wrote in message
    news:[email protected]...
    > Hi I have a user form that opens when the workbook is opened. In this user
    > form I have text fields in which the user shall submitt info. How do I get
    > my
    > macro to "read" the text submitted into the text field after a button on
    > the
    > user form is pressed?




  3. #3
    Tom Ogilvy
    Guest

    RE: Read from text field

    Just access the value of the control:

    msgbox Userform1.Textbox1.Value



    --
    Regards,
    Tom Ogilvy


    "april27" wrote:

    > Hi I have a user form that opens when the workbook is opened. In this user
    > form I have text fields in which the user shall submitt info. How do I get my
    > macro to "read" the text submitted into the text field after a button on the
    > user form is pressed?


+ 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