Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

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

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Singapore
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    363
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Singapore
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thx! It really works
    Regards
    XJ

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •