ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to select all hidden text boxes (https://www.excelbanter.com/excel-discussion-misc-queries/64690-how-select-all-hidden-text-boxes.html)

Manish M Kankaria

How to select all hidden text boxes
 
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.

Norman Jones

How to select all hidden text boxes
 
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


---
Regards,
Norman


"Manish M Kankaria" <Manish M wrote in
message ...
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.




Manish M Kankaria

How to select all hidden text boxes
 
Hi Norman,
Thanks for reply. :)

"Norman Jones" wrote:

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


---
Regards,
Norman


"Manish M Kankaria" <Manish M wrote in
message ...
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.






All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com