Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Delete Row 22 in all Sheets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sean - 18 Sep 2007 18:03 GMT
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
Randy - 18 Sep 2007 18:14 GMT
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
Vergel Adriano - 18 Sep 2007 18:16 GMT
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

Signature

Hope that helps.

Vergel Adriano

> 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.
[quoted text clipped - 3 lines]
>
> Thanks
Don Guillett - 18 Sep 2007 18:34 GMT
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
Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> 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.
[quoted text clipped - 3 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.