Excel VBA problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thanasi742
    New Member
    • Jun 2008
    • 1

    Excel VBA problem

    Well i have a form and im tryin to link a textbox to a cell so the textbox takes up the data in the cell. The first part of the form is having it look up data and putting it into certain cells. The problem is after the data is in the cell it wont go into the textbox unless i type something in it. All im using is UserForm1.TextB ox3 = Sheet1.Range("B 2") in the textbox's code. Is there a way to fix this?
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    sure, you're writing the code in the CHANGE event of the textbox. Use anyother event. I'd use the INITIALIZE event of the form, for example:

    [CODE=vb]Private Sub UserForm_Initia lize()
    UserForm1.TextB ox3 = Sheet1.Range("B 2")
    End Sub[/CODE]

    HTH

    Comment

    Working...