Link to home
Start Free TrialLog in
Avatar of eastsidemarket
eastsidemarket

asked on

add title on pie chart using vba

I am trying to add a chart title to a pie chart and would like it to equal the name of the worksheet. having a hard time getting this to work.

I've tried:

Dim ChartTitle As String
ChartTitle = ws.Name
ActiveChart.ChartTitle.Text = "" & Title

Open in new window


I have also tried:

ActiveChart.ChartTitle.Text = ws.Name

Open in new window


Any ideas? Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Harry Lee
Harry Lee
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slubek
Activechart.HasTitle=True
ActiveChart.ChartTitle.text=ActiveSheet.Name

Open in new window

Avatar of eastsidemarket
eastsidemarket

ASKER

the title piece of the code does the trick, thanks!