Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
|
|||
|
|||
![]()
This will remove text boxes inserted from the drawing toolbar:
Sub tboxkiller() Dim s As Shape For Each s In ActiveSheet.Shapes s.Delete Next End Sub 1. select the worksheet 2. run the macro from that sheet -- Gary''s Student - gsnu200736 "Darin Kramer" wrote: 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
|
|||
|
|||
![]()
You need to be more careful than that. Your code will also delete the arrows
on a data validation cell, or the autofilter dropdown arrow. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Gary''s Student" wrote in message ... This will remove text boxes inserted from the drawing toolbar: Sub tboxkiller() Dim s As Shape For Each s In ActiveSheet.Shapes s.Delete Next End Sub 1. select the worksheet 2. run the macro from that sheet -- Gary''s Student - gsnu200736 "Darin Kramer" wrote: 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
|
|||
|
|||
![]()
Possibly
Sub DeleteTextboxes() dim tbox as TextBox for each tbox in worksheets("Master").TextBoxes tbox.Delete Next End Sub or Sub DeleteTextboxesA() worksheets("Master").Textboxes.Delete End Sub -- Regards, Tom Ogilvy "Gary''s Student" wrote: This will remove text boxes inserted from the drawing toolbar: Sub tboxkiller() Dim s As Shape For Each s In ActiveSheet.Shapes s.Delete Next End Sub 1. select the worksheet 2. run the macro from that sheet -- Gary''s Student - gsnu200736 "Darin Kramer" wrote: 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 *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify (not delete) exact duplicates | Excel Discussion (Misc queries) | |||
VB to identify and delete any text box on a sheet | Excel Programming | |||
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 |