![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 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
__________________
Regards XJ |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 363
|
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.
__________________
It's never too late to learn something new. Ricky |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
Thx! It really works
__________________
Regards XJ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|