Results 1 to 9 of 9

Thread: [solved]Clear Off Arrows in Excel

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    singapore
    Posts
    86

    [solved]Clear Off Arrows in Excel

    I've created some arrows dynamically in an Excel sheet. How am i to delete / clear them off. I'm using a menu command for tat..Pls help. Thank u very much.
    Last edited by ITboy; Apr 2nd, 2003 at 03:19 AM.

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    That'S easy.
    Your arrows are shapes, so clear all shapes
    Works, if the Sheet is activated!
    VB Code:
    1. Sub Clear_Shapes()
    2. Dim i As Integer
    3. Dim j As Integer
    4. i = ActiveSheet.Shapes.Count
    5. For j = 1 To i
    6.     'Must be Shape(1) since they are renumbered after each Delete command!
    7.     ActiveSheet.Shapes(1).Select
    8.     Selection.Delete
    9. Next j
    10. End Sub

    "learned" that using the Macro-Recorder, you could have done it yourself!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    singapore
    Posts
    86
    Opus..I found errors in ur solution but I do not know how to solve it.However, I've got the solution and it is:
    ActiveSheet.DrawingObjects.Delete
    It works man!!!!!

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Errors???
    How did you doo ther arrows?, aren't they Shapes?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    singapore
    Posts
    86
    That's y i told u that they were created dynamically(slightly different) for the blk view against periods.a bit complex.Its alright since its done.

  6. #6
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2003
    Location
    singapore
    Posts
    86
    Hi Opus..Spajeoly has given a link to his code. His is very very similar to yours... I tried his can work but not urs.. Its gd tat if u could go n have a look at Spajeoly's solution jus for info.

  8. #8
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I don'T realy se a reason why Spajeoly'S code should run better than mine????
    His should get same Errors I saw. He covering them with a On Error Resume Next, I made the adjustment in the loop (deleting Shape(1) all the time).

    But I like your version, a one liner, and a couldn't find that one in the Help, damn!!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  9. #9
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    LoL, amazing what that code can do eh @ On Error Resume Next.

    It was the best way to bypass that error but learning that this can be done in one line is kind of irritating lol.

    Oh well, this is how we all learn eh?

Posting Permissions

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



Click Here to Expand Forum to Full Width