ComboBox Question

  • Thread starter Thread starter Gromit
  • Start date Start date
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
 
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
 
Back
Top