Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
EXCEL 2003 - SUBTOTALS
After using the subtotal command, I want to format the spreadsheet by
inserting blank lines before and after each subtotal and grand total. How can I do this without manually inserting blank lines; or how can I create a template with blank lines inserted after each subtotal? -- RCF |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
EXCEL 2003 - SUBTOTALS
Does this work for you?
Option Compare Text Sub insert_rows() Dim RowNdx As Long Dim LastRow As Long LastRow = ActiveSheet.UsedRange.Rows.Count For RowNdx = LastRow To 1 Step -1 If Cells(RowNdx, "C").Value Like "*Total*" Then 'edit "C" to suit Rows(RowNdx + 1).EntireRow.Insert Rows(RowNdx).EntireRow.Insert End If Next RowNdx End Sub Gord Dibben MS Excel MVP On Thu, 25 Mar 2010 08:34:02 -0700, RCF wrote: After using the subtotal command, I want to format the spreadsheet by inserting blank lines before and after each subtotal and grand total. How can I do this without manually inserting blank lines; or how can I create a template with blank lines inserted after each subtotal? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 Subtotals | Excel Discussion (Misc queries) | |||
Subtotals problem: Excel 2003 (not, AFAIK, the nested subtotals bug) | Excel Discussion (Misc queries) | |||
Subtotals in Excel 2003 | Excel Discussion (Misc queries) | |||
Subtotals in Excel 2003 | Excel Discussion (Misc queries) | |||
Subtotals in Excel 2003 | Excel Discussion (Misc queries) |