Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Deleting Auto_Shapes

Hi Everyone
I created a staircase calculator using AutoShapes (Triangles).
I need a macro to erase them.I can't use "Select All" because
it will erase my macro buttons.They are numbered but that changes
every time I use it.
Could I use something like Range "B3:P11 delete Shapes".
I need Help please.
Regards
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Deleting Auto_Shapes

After testing. Just change last 2 comment lines in last macro

Sub AddShapeTriangle()
ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTrian gle, _
213.96, 115.47, 18.34, 29.89).Select
End Sub

Sub DeleteShapeIfTriangle()
For Each sh In ActiveSheet.Shapes
'MsgBox sh.Name
'MsgBox sh.AutoShapeType
If sh.AutoShapeType = 7 Then MsgBox sh.Name
'If sh.AutoShapeType = 7 Then sh.Delete 'MsgBox sh.Name

Next sh
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John" wrote in message
...
Hi Everyone
I created a staircase calculator using AutoShapes (Triangles).
I need a macro to erase them.I can't use "Select All" because
it will erase my macro buttons.They are numbered but that changes every
time I use it.
Could I use something like Range "B3:P11 delete Shapes".
I need Help please.
Regards
John


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Deleting Auto_Shapes

Hi Don
It works perfectly.Thank you again
Best Regards
John
"Don Guillett" wrote in message
...
After testing. Just change last 2 comment lines in last macro

Sub AddShapeTriangle()
ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTrian gle, _
213.96, 115.47, 18.34, 29.89).Select
End Sub

Sub DeleteShapeIfTriangle()
For Each sh In ActiveSheet.Shapes
'MsgBox sh.Name
'MsgBox sh.AutoShapeType
If sh.AutoShapeType = 7 Then MsgBox sh.Name
'If sh.AutoShapeType = 7 Then sh.Delete 'MsgBox sh.Name

Next sh
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John" wrote in message
...
Hi Everyone
I created a staircase calculator using AutoShapes (Triangles).
I need a macro to erase them.I can't use "Select All" because
it will erase my macro buttons.They are numbered but that changes every time
I use it.
Could I use something like Range "B3:P11 delete Shapes".
I need Help please.
Regards
John



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Custom Views when Deleting Sheets ExcelMonkey Excel Programming 1 March 28th 07 06:11 AM
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
how prevent formula in cell from deleting when deleting value???? sh-boom New Users to Excel 1 September 30th 05 06:12 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"