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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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