Anthony's VBA Forum Index Anthony's VBA Forum
Where the knowledge is shared
Menu
 Anthony's VBA Forum IndexHome Page
 Anthony's VBA Forum IndexForum Index
FAQFAQ
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesMessages
Log inLogin/Out

Quick Search

Advanced Search

Links
Consulting
Products

Who's Online
[ Administrator ]
[ Moderator ]


Deleting All Shapes Deletes Data Validation Forms

 
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA
View previous topic :: View next topic  
Author Message
melsahn



Joined: 01 Jun 2009
Posts: 1

PostPosted: Mon Jun 01, 2009 3:10 pm    Post subject: Deleting All Shapes Deletes Data Validation Forms Reply with quote

Hey guys whats up? I just needed some help here with some code I would appreciate any help of course I just cant seem to figure this out...

What I am trying to do here is select a value from a drop down which is linked to a formula which triggers the macro shape..i have all that down already... but the problem is that I will have multiple values in the same drop down and I needed to figure a way to delete the previous macro shape in that range. And so i have created the delete all shapes code below but it seems whenever I use the code it deletes the data validation drop downs

here is what I have so far...

[CODE]
Function Macro()
'

DELETEALLSHAPES
'

'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 220.5, 105.75, 92.25, 51#). _
Select
End Function


Function CIRCLES()
'

DELETEALLSHAPES
'

'
ActiveSheet.Shapes.AddShape(msoShapeOval, 203.25, 101.25, 44.25, 34.5).Select
ActiveSheet.Shapes.AddShape(msoShapeOval, 267#, 102#, 28.5, 30#).Select
ActiveSheet.Shapes.AddShape(msoShapeOval, 246.75, 141#, 30.75, 27.75).Select
End Function


Sub DELETEALLSHAPES()
Set RNG = Range("E8:G14")
For Each SH In ActiveSheet.Shapes
If Not Application.Intersect(RNG, SH.TopLeftCell) Is Nothing Then
SH.Delete
End If
Next
End Sub
[/CODE]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group