PC Review


Reply
Thread Tools Rate Thread

Delete Row 22 in all Sheets

 
 
Sean
Guest
Posts: n/a
 
      18th Sep 2007
How would I delete Row 25 in all sheets of my workbook. I've 54 sheets
so would prefer to do via code rather than manually.

Also how would I add the simple formula =sum(A45:A55) to Columns A-G
(in cell 57) on each sheet also?

Thanks

 
Reply With Quote
 
 
 
 
Randy
Guest
Posts: n/a
 
      18th Sep 2007
Try this:

Sub Del22()
Dim wks As Worksheet
Dim wb As Workbook
Set wb = ThisWorkbook

For Each wks In wb.Worksheets
wks.Rows("25").Delete
Next
End Sub

Randy

 
Reply With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      18th Sep 2007
try something like this:

Sub test()
Dim sh As Worksheet

For Each sh In Worksheets
sh.Rows(25).Delete
sh.Range("A57:G57").Formula = "=SUM(A45:A55)"
Next sh

End Sub

--
Hope that helps.

Vergel Adriano


"Sean" wrote:

> How would I delete Row 25 in all sheets of my workbook. I've 54 sheets
> so would prefer to do via code rather than manually.
>
> Also how would I add the simple formula =sum(A45:A55) to Columns A-G
> (in cell 57) on each sheet also?
>
> Thanks
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      18th Sep 2007

Without a macro simply select all sheets and on any one delete the row using
the row header (left) and write your formula in cell 57. Then select any
sheet to UN group
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Sean" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How would I delete Row 25 in all sheets of my workbook. I've 54 sheets
> so would prefer to do via code rather than manually.
>
> Also how would I add the simple formula =sum(A45:A55) to Columns A-G
> (in cell 57) on each sheet also?
>
> Thanks
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sub to delete all sheets other than x, y, z Max Microsoft Excel Programming 6 2nd Jan 2008 01:04 AM
Delete Sheets Andibevan Microsoft Excel Programming 3 24th Jun 2005 12:17 AM
Re: Macro to delete sheets and saves remaining file does not properly delete module gazornenplat Microsoft Excel Programming 0 22nd Jun 2005 01:12 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Microsoft Excel Programming 7 21st Jun 2005 05:16 PM
delete all sheets except... caroline Microsoft Excel Programming 4 22nd May 2004 04:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:05 PM.