Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default How to stop CommandButtons being deleted as pictures in code??

ActiveSheet.Pictures.Delete

I need to modify the above so that it does not include all the commandbuttons, but how?
I need commandbuttons and not a forms - button as the code needs to be exportable to other files and to take the code with them.

Any ideas?
Corey....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to stop CommandButtons being deleted as pictures in code??

Hi Corey,

Try:

'=============
Public Sub Tester()
Dim SHP As Shape

For Each SHP In ActiveSheet.Shapes
With SHP
If .Type = msoPicture Then
.Delete
End If
End With
Next SHP
End Sub
'<<=============



---
Regards,
Norman



"Corey" wrote in message
...
ActiveSheet.Pictures.Delete

I need to modify the above so that it does not include all the
commandbuttons, but how?
I need commandbuttons and not a forms - button as the code needs to be
exportable to other files and to take the code with them.

Any ideas?
Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default How to stop CommandButtons being deleted as pictures in code??

thanks Norman.
Perfect
"Norman Jones" wrote in message
...
Hi Corey,

Try:

'=============
Public Sub Tester()
Dim SHP As Shape

For Each SHP In ActiveSheet.Shapes
With SHP
If .Type = msoPicture Then
.Delete
End If
End With
Next SHP
End Sub
'<<=============



---
Regards,
Norman



"Corey" wrote in message
...
ActiveSheet.Pictures.Delete

I need to modify the above so that it does not include all the
commandbuttons, but how?
I need commandbuttons and not a forms - button as the code needs to be
exportable to other files and to take the code with them.

Any ideas?
Corey....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to stop CommandButtons being deleted as pictures in code??

Hi Corey,

Additionally, see Ron de Bruin's discussion at:

http://www.rondebruin.nl/controlsobjectsworksheet.htm

See particularly the section entitled: 'Delete only specific shapes'


---
Regards,
Norman




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default How to stop CommandButtons being deleted as pictures in code??

Dim SHP As Shape

For Each SHP In ActiveSheet.Shapes <======== How can i change this to
ALL Sheets in workbook ?
With SHP
If .Type = msoPicture Then
.Delete
End If
End With
Next SHP

Corey....
"Norman Jones" wrote in message
...
Hi Corey,

Additionally, see Ron de Bruin's discussion at:

http://www.rondebruin.nl/controlsobjectsworksheet.htm

See particularly the section entitled: 'Delete only specific shapes'


---
Regards,
Norman








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to stop CommandButtons being deleted as pictures in code??

Hi Corey,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim SHP As Shape

For Each SH In ThisWorkbook.Worksheets
For Each SHP In SH.Shapes
With SHP
If .Type = msoPicture Then
.Delete
End If
End With
Next SHP
Next SH
End Sub
'<<=============


---
Regards,
Norman



"Corey" wrote in message
...
Dim SHP As Shape

For Each SHP In ActiveSheet.Shapes <======== How can i change this to
ALL Sheets in workbook ?
With SHP
If .Type = msoPicture Then
.Delete
End If
End With
Next SHP

Corey....



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
how to lock pictures from moving or being deleted in excel 2007 Joel Excel Discussion (Misc queries) 1 April 18th 07 03:44 PM
Stop rows from being deleted whilst allowing cells contents to cha SueD Excel Discussion (Misc queries) 2 August 22nd 06 02:59 PM
Pictures.Visible question (after adding many pictures, they stop disappearing) Abe[_4_] Excel Programming 2 July 11th 06 05:02 AM
VB Code to stop cells being deleted T Jeanes Excel Programming 2 July 8th 04 01:05 PM
Stop Excel Updating formulas when cells are deleted? tom[_5_] Excel Programming 4 January 23rd 04 09:59 AM


All times are GMT +1. The time now is 02:28 AM.

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

About Us

"It's about Microsoft Excel"