Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Delete Row 22 in all Sheets

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Delete Row 22 in all Sheets

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Delete Row 22 in all Sheets

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Delete Row 22 in all Sheets


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

"Sean" wrote in message
oups.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.

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

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 1 June 22nd 05 01:12 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:54 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"