+ Reply to Thread
Results 1 to 2 of 2

Code to fill ActiveX text box with value from UserForm text box

Hybrid View

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Code to fill ActiveX text box with value from UserForm text box

    I have a workbook with a number of worksheets. I have created a UserForm that has a few text boxes in it. Upon exiting this UserForm using the OK button, the data entered into the text boxes is put into cells on one worksheet.

    I have another worksheet that has a number of ActiveX text boxes. I want the code that runs when exiting the UserForm using the OK button to also fill a specific ActiveX text box with the data entered in a particular text box in the UserForm.

    I have tried the following code:
    With Sheet3.TextBox1.Text = DiscReq.TextBox1
        
    End With
    This code does nothing. No error. No change to the text box on sheet 3.

    Can anyone help?

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Code to fill ActiveX text box with value from UserForm text box

    Private Sub CommandButton1_Click()
    Sheet3.Range("A1").Value = Me.TextBox1.Value ' <=== modify sheet range to suit
    Sheet3.TextBox1.Value = Me.TextBox1.Value ' <=== modify sheet and Active X textbox number/name to suit
    Unload Me
    End Sub
    Works for me.

+ 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