Change Chart Title - Based on Drop Down

excelenergy

Board Regular
Joined
Jun 7, 2012
Messages
142
Hello,

I don't care if I have to use VBA or a formula, I was just hoping someone might know how to do this...
I have a 'form control' drop down list (it is NOT) a data validation drop down list...Its a form control. The form control has a list of Fruit...Everytime someone selects a different fruit I want the name of my chart title to change to whatever was selected in the drop down.

Does anyone know how to make that happen?

Thank you In advance!!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Given -

Chart Name = "Chart 1"
Drop Down Name = "DropDown 1"


Try this:


Code:
Sub DropDown1_Change()

dim dd As DropDown
Set dd = [COLOR=#303336][FONT=Consolas]ActiveSheet.Shapes(Application.Caller).OLEFormat.Object[/FONT][/COLOR]

[COLOR=#303336][FONT=Consolas]ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartTile.Text = dd.List(dd.ListIndex)

End Sub

[/FONT][/COLOR]

If the chart has a different name, replace "Chart 1" with "yournamehere"

If the drop down has a different name, just rename the Sub, right click the dropdown element and Assign Macro... to the newly named sub
 
Upvote 0
And that did the trick!!

Thank you!


Given -

Chart Name = "Chart 1"
Drop Down Name = "DropDown 1"


Try this:


Code:
Sub DropDown1_Change()

dim dd As DropDown
Set dd = [COLOR=#303336][FONT=Consolas]ActiveSheet.Shapes(Application.Caller).OLEFormat.Object[/FONT][/COLOR]

[COLOR=#303336][FONT=Consolas]ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartTile.Text = dd.List(dd.ListIndex)

End Sub

[/FONT][/COLOR]

If the chart has a different name, replace "Chart 1" with "yournamehere"

If the drop down has a different name, just rename the Sub, right click the dropdown element and Assign Macro... to the newly named sub
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top