• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

userform text box populates based on selection.

I am trying to get the userform textbox to automatically change when the user selects a different cell on the worksheet(like an event change), and the value of the selection now becomes the value used in the code as well as being displayed in the textbox.
 
Write your code under Worksheet_SelectionChange event (on Worksheet object). Be aware that this event triggers with every other selection you make on worksheet. If you want to do it only for a certain range, you can validate the address of the selection.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

UserForm1.TextBox1.Text = Target.Text

UserForm1.Show

End Sub
 
Back
Top