Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert row on multiple sheets
Dave the code works well , but is it possible to insert the row starting at
the 6th sheet instead of the 1st sheet? Please Option Explicit Sub NewRow() Dim EndRowA As Long Dim NextRowAF As Long Dim wks As Worksheet Dim iRow As Long For Each wks In ActiveWorkbook.Worksheets With wks EndRowA = Cells(.Rows.Count, "A").End(xlUp).Row NextRowAF = .Cells(.Rows.Count, "AF").End(xlUp).Row + 1 ..Cells(NextRowAF, "AC").Value = "Total" ..Cells(NextRowAF, "AF").Formula _ = "=sum(AF5:AF" & NextRowAF - 1 & ")" With Union(.Cells(NextRowAF, "AF"), .Cells(NextRowAF, "AC")) ..Font.Bold = True ..Font.ColorIndex = 2 ..Interior.ColorIndex = 32 ..Borders.LineStyle = xlContinuous ..Borders.ColorIndex = 2 ..Borders.Weight = xlThin End With For iRow = NextRowAF + 1 To 32 If Application.CountA(.Rows(iRow)) = 0 Then ..Rows(iRow).Interior.ColorIndex = 2 End If Next iRow ..Rows("5:32").RowHeight = 12.75 End With Next wks End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert row on multiple sheets | Excel Discussion (Misc queries) | |||
Insert Columns in multiple sheets | Excel Worksheet Functions | |||
How do you insert rows into multiple sheets in a workbook? | Excel Discussion (Misc queries) | |||
insert Rows with Formulas in Place on Multiple Sheets? | Excel Discussion (Misc queries) | |||
Insert same picture in multiple sheets and only change once | Excel Discussion (Misc queries) |