close

for example, i create a simple macro for inserting a row above a certain
cell. I want the macro applied to all sheets when running the macro.
Does anyone know how to do this? thanks a lot!--
minrufeng
------------------------------------------------------------------------
minrufeng's Profile: www.excelforum.com/member.php...oamp;userid=26208
View this thread: www.excelforum.com/showthread...hreadid=515021try
Sub insertrowinallsheets()
myrow = ActiveCell.Row
For Each ws In Worksheets
ws.Rows(myrow).Insert
Next
End Sub--
Don Guillett
SalesAid Software

quot;minrufengquot; gt; wrote
in message ...
gt;
gt; for example, i create a simple macro for inserting a row above a certain
gt; cell. I want the macro applied to all sheets when running the macro.
gt; Does anyone know how to do this? thanks a lot!
gt;
gt;
gt; --
gt; minrufeng
gt; ------------------------------------------------------------------------
gt; minrufeng's Profile:
gt; www.excelforum.com/member.php...oamp;userid=26208
gt; View this thread: www.excelforum.com/showthread...hreadid=515021
gt;
see
www.mvps.org/dmcritchie/excel...htm#loopsheets
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: www.mvps.org/dmcritchie/excel/excel.htm
Search Page: www.mvps.org/dmcritchie/excel/search.htm

quot;minrufengquot; gt; wrote in message
...
gt;
gt; for example, i create a simple macro for inserting a row above a certain
gt; cell. I want the macro applied to all sheets when running the macro.
gt; Does anyone know how to do this? thanks a lot!
gt;
gt;
gt; --
gt; minrufeng
gt; ------------------------------------------------------------------------
gt; minrufeng's Profile: www.excelforum.com/member.php...oamp;userid=26208
gt; View this thread: www.excelforum.com/showthread...hreadid=515021
gt;

However, if I misoperate a macro to all worksheets and want to undo this
operation, what should I do? Thanks for your great help!--
minrufeng
------------------------------------------------------------------------
minrufeng's Profile: www.excelforum.com/member.php...oamp;userid=26208
View this thread: www.excelforum.com/showthread...hreadid=515021Save your workbook before you run this macro.

If you screw it up, then close that workbook without saving and reopen it.

minrufeng wrote:
gt;
gt; However, if I misoperate a macro to all worksheets and want to undo this
gt; operation, what should I do? Thanks for your great help!
gt;
gt; --
gt; minrufeng
gt; ------------------------------------------------------------------------
gt; minrufeng's Profile: www.excelforum.com/member.php...oamp;userid=26208
gt; View this thread: www.excelforum.com/showthread...hreadid=515021

--

Dave Peterson

try.
Sub insertrowinallsheets()
myrow = ActiveCell.Row
For Each ws In Worksheets
ws.Rows(myrow).DELETE
Next
End Sub--
Don Guillett
SalesAid Software

quot;minrufengquot; gt; wrote
in message ...
gt;
gt; However, if I misoperate a macro to all worksheets and want to undo this
gt; operation, what should I do? Thanks for your great help!
gt;
gt;
gt; --
gt; minrufeng
gt; ------------------------------------------------------------------------
gt; minrufeng's Profile:
gt; www.excelforum.com/member.php...oamp;userid=26208
gt; View this thread: www.excelforum.com/showthread...hreadid=515021
gt;

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

    software

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