Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default 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
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
Insert row on multiple sheets aussiegirlone Excel Discussion (Misc queries) 6 July 17th 09 12:54 PM
Insert Columns in multiple sheets Needs Help Excel Worksheet Functions 3 January 24th 08 07:46 PM
How do you insert rows into multiple sheets in a workbook? Marketing Queen Excel Discussion (Misc queries) 2 May 30th 06 05:33 PM
insert Rows with Formulas in Place on Multiple Sheets? Michael Link Excel Discussion (Misc queries) 5 March 9th 06 01:54 PM
Insert same picture in multiple sheets and only change once Mike Excel Discussion (Misc queries) 3 February 7th 06 03:05 PM


All times are GMT +1. The time now is 09:30 PM.

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"