ComboBox Question

G

Gromit

Hi,

I have a chart that's being created and formated by VBA. I want to add
a title to the chart that's same as the selection of a combobox.

How do I point the chart title property to the ComboBox selection
property? I'm having difficultly figuring out how the Active X controls
fit within Excel's object model - the help diagram seems only to refer
to forms controls, unless I'm missing something...?

In psuedo code, what I want to achieve is this:

With myChtObj.Chart
HasTitle = True
ChartTitle.Characters.Text = ComboBox1.LinkedCell.Value
End With

Any help much appreciated!!

Thanks,

Graham
 
J

Jon Peltier

Hi Graham -

No macros needed. Put your list items in F1 to F5.

A. Controls Toolbox Combobox:

Set the ListFillRange property to F1:F5. Set the LinkedCell property to
H1.

B. Forms Commandbar Combobox:

Set the Input Range to F1:F5. Set the Cell Link property to G1. Enter
this formula in H1:

=INDEX(F1:F5,G1)

For either combobox, select the chart title, press the equals key, and
click on cell H1. When the combobox changes, so does the value in H1,
and the linked title also changes.

- Jon
 

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