Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Drawn Objects Q

I have the code below which deletes "Objects" in my sheet, my problem is that it deletes a cell in Column A and moves all cells up one space, I don't know why this is occurring

When I try and select "Objects" within Find-Go to Special-Objects, it says there is none to be found and that is before I run the code below

Hope someone can advise

Thanks


Sub ClearMacroButtons()
Application.ScreenUpdating = False

Sheets("Figures").Visible = True
Sheets("Figures").Select
ActiveSheet.Unprotect Password:="1234"
ActiveSheet.DrawingObjects.Select
Selection.Delete
Range("A1").Select
ActiveSheet.Protect Password:="1234"

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Drawn Objects Q

Try below and see what happens ..

Option Explicit

Sub FormatAllCallouts()
Dim oShp As Shape
Dim oCF As CalloutFormat
On Error GoTo MyExit

Sheets("Figures").Visible = True
Sheets("Figures").Select
ActiveSheet.Unprotect Password:="1234"
For Each oShp In ActiveSheet.Shapes
oShp.Select
Selection.Delete
Next
Range("A1").Select
ActiveSheet.Protect Password:="1234"

Exit Sub
MyExit:
MsgBox "No shapes found!!""
End Sub





On Tuesday, 11 February 2014 20:12:42 UTC+5:30, wrote:
I have the code below which deletes "Objects" in my sheet, my problem is that it deletes a cell in Column A and moves all cells up one space, I don't know why this is occurring



When I try and select "Objects" within Find-Go to Special-Objects, it says there is none to be found and that is before I run the code below



Hope someone can advise



Thanks





Sub ClearMacroButtons()

Application.ScreenUpdating = False



Sheets("Figures").Visible = True

Sheets("Figures").Select

ActiveSheet.Unprotect Password:="1234"

ActiveSheet.DrawingObjects.Select

Selection.Delete

Range("A1").Select

ActiveSheet.Protect Password:="1234"



End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Drawn Objects Q

On Friday, February 14, 2014 6:58:02 PM UTC, Abhijeet Gudur wrote:
Try below and see what happens ..



Option Explicit



Sub FormatAllCallouts()

Dim oShp As Shape

Dim oCF As CalloutFormat

On Error GoTo MyExit



Sheets("Figures").Visible = True

Sheets("Figures").Select

ActiveSheet.Unprotect Password:="1234"

For Each oShp In ActiveSheet.Shapes

oShp.Select

Selection.Delete

Next

Range("A1").Select

ActiveSheet.Protect Password:="1234"



Exit Sub

MyExit:

MsgBox "No shapes found!!""

End Sub











On Tuesday, 11 February 2014 20:12:42 UTC+5:30, wrote:

I have the code below which deletes "Objects" in my sheet, my problem is that it deletes a cell in Column A and moves all cells up one space, I don't know why this is occurring








When I try and select "Objects" within Find-Go to Special-Objects, it says there is none to be found and that is before I run the code below








Hope someone can advise








Thanks












Sub ClearMacroButtons()




Application.ScreenUpdating = False








Sheets("Figures").Visible = True




Sheets("Figures").Select




ActiveSheet.Unprotect Password:="1234"




ActiveSheet.DrawingObjects.Select




Selection.Delete




Range("A1").Select




ActiveSheet.Protect Password:="1234"








End Sub


Your code returns "no shapes found", but why then in my original code, if there is no objects found it deletes a cell in Column A and moves all cells up one space

My code is wrong, but I don't know why
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
excel2007 objects drawn on charts move in print preview Paste charts as enchanced metafile Charts and Charting in Excel 0 July 30th 09 02:54 PM
How does one select multiple drawn objects in Excel 2007? JakeA Excel Discussion (Misc queries) 1 March 8th 08 03:58 PM
Using Macros to manipulate drawn objects Elliot Excel Discussion (Misc queries) 0 May 24th 07 03:13 PM
text boxes drawn objects do not appear on chart E.M. Charts and Charting in Excel 1 December 12th 06 10:38 PM
Copy Excel Chart (including drawn objects) into Word MarkN Charts and Charting in Excel 3 February 13th 06 02:09 PM


All times are GMT +1. The time now is 01:52 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"