close

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.

Hi Manish,

Try:
'=============gt;gt;
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
'lt;lt;=============

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

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:

www.contextures.com/xlfaqApp.html#Unused---
Regards,
Normanquot;Manish M Kankariaquot; lt;Manish M gt; wrote in
message ...
gt; Hi,
gt; I have just operational knowledge of Excel. I have copied few cells from
gt; one
gt; excel file to new excel file.
gt; Source file contains some macros.
gt; I don't know, duew to this or what, in the new file, many hidden text
gt; fields
gt; are there. For that reason file size is more than 5 MB which actully
gt; should
gt; have less than 1 MB.
gt; I'm unable to select all the hidden text boxes at a time to delete them.
gt; Please guide me in this regard.
Hi Norman,
Thanks for reply.

quot;Norman Jonesquot; wrote:

gt; Hi Manish,
gt;
gt; Try:
gt; '=============gt;gt;
gt; Public Sub Tester2()
gt; Dim sh As Worksheet
gt; For Each sh In ActiveWorkbook.Worksheets
gt; With sh
gt; .OLEObjects.Delete
gt; .TextBoxes.Delete
gt; End With
gt; Next sh
gt; End Sub
gt; 'lt;lt;=============
gt;
gt; If you are not familiar with macros, you may wish to visit David McRitchie's
gt; 'Getting Started With Macros And User Defined Functions' at:
gt;
gt; www.mvps.org/dmcritchie/excel/getstarted.htm
gt;
gt; Having run the above macro, you might wish to look at Debra Dalgleish's
gt; suggestions for resetting the used range at:
gt;
gt; www.contextures.com/xlfaqApp.html#Unused
gt;
gt;
gt; ---
gt; Regards,
gt; Norman
gt;
gt;
gt; quot;Manish M Kankariaquot; lt;Manish M gt; wrote in
gt; message ...
gt; gt; Hi,
gt; gt; I have just operational knowledge of Excel. I have copied few cells from
gt; gt; one
gt; gt; excel file to new excel file.
gt; gt; Source file contains some macros.
gt; gt; I don't know, duew to this or what, in the new file, many hidden text
gt; gt; fields
gt; gt; are there. For that reason file size is more than 5 MB which actully
gt; gt; should
gt; gt; have less than 1 MB.
gt; gt; I'm unable to select all the hidden text boxes at a time to delete them.
gt; gt; Please guide me in this regard.
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()