Solved

Excel with Hundreds of Invisible Text Boxes

Posted on 2013-01-27
3
269 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article will show you how to use shortcut menus in the Access run-time environment.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now