Managing a MS Excel Chart using VB

shimotojr

New Member
Joined
Nov 19, 2020
Messages
1
Office Version
  1. 2010
Platform
  1. Windows
Good day,
Thank you for allowing me to be a member of this page or group.
Want to ask how can I assign a name of a chart using VB codes.

I'm only a newbie in MSExcel VB codes.

Hope you can help me guys.


Thank you in advance.

shimotojr
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi shimotojr and Welcome to the Board! Not quite clear if U want to refer to a chart or name a chart? Anyways, there are 2 types of charts. Charts embedded on a sheet and charts that are their own sheet. To reference either generically you can use...
Code:
ActiveChart
To reference embedded charts...
Code:
Sheets("Sheet1").ChartObjects(1)' 1 is the chart index
Sheets("Sheet1").ChartObjects("ChartName")
To reference a chart sheet...
Code:
Sheets("ChartName")'
To name a chart I think U can just do something like this...
Code:
Sheets("Sheet1").ChartObjects(1).Name = "YourChartName"
Google either Jon Peltier of Tushar Mehta for exact chart knowledge. HTH. Dave
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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