How to select all hidden text boxes

M

Manish M Kankaria

Hi,
I have just operational knowledge of Excel. I have copied few cells from one
excel file to new excel file.
Source file contains some macros.
I don't know, duew to this or what, in the new file, many hidden text fields
are there. For that reason file size is more than 5 MB which actully should
have less than 1 MB.
I'm unable to select all the hidden text boxes at a time to delete them.
Please guide me in this regard.
 
N

Norman Jones

Hi Manish,

Try:
'=============>>
Public Sub Tester2()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
With sh
.OLEObjects.Delete
.TextBoxes.Delete
End With
Next sh
End Sub
'<<=============

If you are not familiar with macros, you may wish to visit David McRitchie's
'Getting Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Having run the above macro, you might wish to look at Debra Dalgleish's
suggestions for resetting the used range at:

http://www.contextures.com/xlfaqApp.html#Unused
 
M

Manish M Kankaria

Hi Norman,
Thanks for reply. :)

Norman Jones said:
Hi Manish,

Try:
'=============>>
Public Sub Tester2()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
With sh
.OLEObjects.Delete
.TextBoxes.Delete
End With
Next sh
End Sub
'<<=============

If you are not familiar with macros, you may wish to visit David McRitchie's
'Getting Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Having run the above macro, you might wish to look at Debra Dalgleish's
suggestions for resetting the used range at:

http://www.contextures.com/xlfaqApp.html#Unused
 
Top