ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Row 22 in all Sheets (https://www.excelbanter.com/excel-programming/397674-delete-row-22-all-sheets.html)

Sean

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


Randy[_2_]

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


Vergel Adriano

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



Don Guillett

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




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com