Excel crash based on this action

G

Guest

I have a graph linked to a macro located in Module 1
sub graph_click
worksheets(2).activate
[A1] = "chartype"
end sub
On worksheet#2, I have a comboBox that I want the value to default to
"charttype" which is 1 of the drop down values. I first tried combobox1.value
= "charttype" and it didn't work. As a workaround, I update the cell that the
combobox is linked to in this case A1. However, after 2 clicks test on the
graph, my excel always crashed. Is it because I am not supposed to update the
cell that is linked to the combobox result?

Help
 
G

Guest

Try using the ListIndex property of the combobox to set the default value.
The first item in the list has a listindex number of 0. If your "charttype"
value is the 3rd irem in the list, you would use a ListIndex value of 2.

eg:

sub graph_click
worksheets(2).activate
ComboBox1.ListIndex = 2
end sub
 
G

Guest

Thanks. That seems to fix the problem. No more crashes.

Dom_Ciccone said:
Try using the ListIndex property of the combobox to set the default value.
The first item in the list has a listindex number of 0. If your "charttype"
value is the 3rd irem in the list, you would use a ListIndex value of 2.

eg:

sub graph_click
worksheets(2).activate
ComboBox1.ListIndex = 2
end sub


matelot said:
I have a graph linked to a macro located in Module 1
sub graph_click
worksheets(2).activate
[A1] = "chartype"
end sub
On worksheet#2, I have a comboBox that I want the value to default to
"charttype" which is 1 of the drop down values. I first tried combobox1.value
= "charttype" and it didn't work. As a workaround, I update the cell that the
combobox is linked to in this case A1. However, after 2 clicks test on the
graph, my excel always crashed. Is it because I am not supposed to update the
cell that is linked to the combobox result?

Help
 

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

Top