Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim mpOLE As Object
For Each mpOLE In ActiveSheet.OLEObjects If TypeName(mpOLE.Object) = "TextBox" Then mpOLE.Delete End If Next mpOLE -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Darin Kramer" wrote in message ... Hi There, I have a sheet called "Master" on which through macros several text boxes have been inadvertenly pasted. I want to run a macro that will select and delete all text boxes on a sheet (irrespecitve of the text box number...) Thanks!!! Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Bob, I added Sheets("Master").select to get it to go to the correct sheet. However the Macro does not work - ie it skips over the first if, ie doesnt find any text boxes to delete... Am I doing something wrong...? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Darin,
Where did the textboxes come from. I am assuming the controls toolbox, but maybe not? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Darin Kramer" wrote in message ... Bob, I added Sheets("Master").select to get it to go to the correct sheet. However the Macro does not work - ie it skips over the first if, ie doesnt find any text boxes to delete... Am I doing something wrong...? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If they are shapes from the drawing toolbar, try
Sub DeleteTextBoxes() Dim shp As Shape For Each shp In Worksheets("Master").Shapes If shp.Type = msoTextBox Then shp.Delete End If Next shp End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Darin Kramer" wrote in message ... Bob, I added Sheets("Master").select to get it to go to the correct sheet. However the Macro does not work - ie it skips over the first if, ie doesnt find any text boxes to delete... Am I doing something wrong...? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify (not delete) exact duplicates | Excel Discussion (Misc queries) | |||
Identify the duplicate and delete with details in excel | Excel Discussion (Misc queries) | |||
How to identify text (compare) in one sheet, then move it another | Excel Programming | |||
How to identify text (compare) in one sheet, then move it another | Excel Programming | |||
How can I programatically identify and delete an image? | Excel Programming |