Combobox help.....really easy I imagine

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I have a combobox that has 8 listed items lets say 1-8. I would like
where if you choose 3 in the combobox cell D6 changes to 3 then if I
choose 6 cell chooses 6 and so, whatever number i choose changes D6 to
equal that value. Also I have a chart macro attached to each number
whereas I choose 3 a chart will generate and a different chart will
generate the same for the rest of the numbers. Any help.

Ryan
 
One way is to double click the combo box while in design mode and put this
between the two lines of code that appear there:

The final product should be:

Private Sub ComboBox1_Click()
ActiveSheet.Range("D6") = ComboBox1.Value
End Sub

There are a couple of other ways to do it, but this is as good as the others.
 
One way is to double click the combo box while in design mode and put this
between the two lines of code that appear there:

The final product should be:

Private Sub ComboBox1_Click()
ActiveSheet.Range("D6") = ComboBox1.Value
End Sub

There are a couple of other ways to do it, but this is as good as the others.

How do I link that code to the combobox? Whats the difference between
private sub and sub? because private sub doesnt come up when I assign
a macro to the combobox but sub does?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top