Solved

Excel with Hundreds of Invisible Text Boxes

Posted on 2013-01-27
3
288 Views
Last Modified: 2013-02-18
Hello,

I'm troubleshooting a very slow Excel spreadsheets.  It's a 1 worksheet workbook, with only one page of data.

When I go to the "Page Layout" -> Selection Pane, I see hundreds of text boxes.  When I click on one of them, nothing appears/dissappears.  If I randomly click somewhere on the page, I might click on one of these text boxes, which draws a border around it until it loses focus.

Is there anyway to delete all of these items at once?  I have not idea what caused them to be created in the first place.  

Thanks for any advice
0
Comment
Question by:compsol1993
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 500 total points
ID: 38825209
Hi, compsol1993.

This is a problem I've seen here a number of times. The macro below will delete all Shapes in the current sheet. (ListBoxes are one type of Shape.)
Sub Delete_All_Shapes()
Dim xResponse As Long
Dim xShape    As Shape

If ActiveSheet.Shapes.count = 0 Then
    MsgBox ("No Shapes in the current sheet. Run cancelled.")
    Exit Sub
End If

xResponse = MsgBox("About to delete all of the current sheet's Shapes. [" & ActiveSheet.Shapes.count & "]" & Chr(10) _
                                & "('OK' to continue, 'Cancel' to quit.)", vbOKCancel, "Delete All Shapes")
If xResponse = 2 Then Exit Sub

For Each xShape In ActiveSheet.Shapes

    xShape.Delete
    
Next

End Sub

Open in new window

Regards,
Brian.
0
 

Author Closing Comment

by:compsol1993
ID: 38903098
Perfect!  Thanks for the help
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38903337
Thanks, compsol1993.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question