How to refer to a Chart knowing its left upper corner?

Andrew XJ

Board Regular
Joined
Feb 21, 2002
Messages
77
Could you tell me how to refer to a Chart knowing where its left upper corner resides.
Current there are quite a few charts in a spreedsheet. I need to delete charts whose left corner reside in certain cells.

regards
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try this:

Sub DeleteChart()
Dim ch As ChartObject
For Each cell In Range("DeleteRange")
For Each ch In ActiveSheet.ChartObjects
If ch.TopLeftCell.Address = UCase(cell.Value) Then ch.Delete
Next
Next
End Sub


In the workbook set up a range named "DeleteRange" and enter the location of the cells of the upper left corner of the charts to be deleted. The cell location must be enter in absolute method (includes $) such as: $A$1.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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