Results 1 to 4 of 4

Thread: Solved: Combobox Value in Userform to a textbox in an activeworksheet

  1. #1
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location

    Solved: Combobox Value in Userform to a textbox in an activeworksheet

    Hello,

    How can i save a combobox value from a user form to a textbox place in a worksheet.

    [VBA] Private Sub cmdSave_Click()
    Sheets("training!txtTrainer1").Value = cmbTrainer2.Value

    End Sub[/VBA]

    Error message is;

    Run Time error (9)
    Subscript is out of range

    Thank you in advance for any help out.

  2. #2
    This worked for me:
    [vba]Private Sub cmdSave_Click()
    Sheets("training").txtTrainer1.Text = cmbTrainer2.Value
    End Sub[/vba]

  3. #3
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    huhhh it was an easy code but without the expert like you how will i know... A big dump of thankssss...

  4. #4
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi jammer,
    If your thread is solved please mark it as solved using the thread tools at the top of the page....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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