list box- copy selected to seperate sheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paul138
    New Member
    • Dec 2009
    • 5

    list box- copy selected to seperate sheet

    Hi People,

    I have a listbox on a user form ,and want the user to select 1 country from it, then click an ok button.

    When they click the OK button i want a macro to copy the name of the country into cell a1, in sheet1.

    What would the code be for this?
    Its easy i know, i just cant do it lol.

    Please help.

    Thanks in advance
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by paul138
    Hi People,

    I have a listbox on a user form ,and want the user to select 1 country from it, then click an ok button.

    When they click the OK button i want a macro to copy the name of the country into cell a1, in sheet1.

    What would the code be for this?
    Its easy i know, i just cant do it lol.

    Please help.

    Thanks in advance
    Assuming your Combo on the UserForm is named ComboBox1:
    Private Sub ComboBox1_After Update()
    Worksheets("She et1").Range("A1 ").Value = ComboBox1.Value
    End Sub

    Comment

    Working...