combo box output from sheet 1 to sheet 2

  • i have placed a combo box on sheet 1. i need the numbers 1 to 24 in the combo box. when i click on a number in the combo box i want it to put it in cell a1 on sheet 2
    regards john

  • Re: combo box output from sheet 1 to sheet 2


    Hey John,


    Just use this code:

    Code
    Private Sub ComboBox1_click()
    Sheet2.range("A1") = ComboBox1.value
    End Sub
  • Re: combo box output from sheet 1 to sheet 2


    If you need to add the numbers to the comboBox, there are a few ways to do it. If it will always be 1 to 24 then you can use this code:


    Code
    Private Sub Worksheet_Activate()
    Dim i  As Integer
    For i = 1 to 24
       ComboBox1.AddItem i
    Next i
    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!