|
-
Apr 2nd, 2003, 01:58 AM
#1
Thread Starter
Lively Member
[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.
-
Apr 2nd, 2003, 02:30 AM
#2
That'S easy.
Your arrows are shapes, so clear all shapes
Works, if the Sheet is activated!
VB Code:
Sub Clear_Shapes()
Dim i As Integer
Dim j As Integer
i = ActiveSheet.Shapes.Count
For j = 1 To i
'Must be Shape(1) since they are renumbered after each Delete command!
ActiveSheet.Shapes(1).Select
Selection.Delete
Next j
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!
-
Apr 2nd, 2003, 03:19 AM
#3
Thread Starter
Lively Member
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!!!!!
-
Apr 2nd, 2003, 03:34 AM
#4
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!
-
Apr 2nd, 2003, 04:13 AM
#5
Thread Starter
Lively Member
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.
-
Apr 2nd, 2003, 10:51 AM
#6
Frenzied Member
-
Apr 2nd, 2003, 11:45 AM
#7
Thread Starter
Lively Member
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.
-
Apr 3rd, 2003, 01:42 AM
#8
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!
-
Apr 3rd, 2003, 09:57 AM
#9
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|