Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Column A Column B Column C
- Header 1 detail detail
- detail detail
- Count
- Header 2 detail detail
- detail detail
- Count
- Grand Total
- Column A Column B Column C
- Header 1 detail detail
- detail detail
- Count
- Header 2 detail detail
- detail detail
- Count
- Header 3 detail detail
- detail detail
- Count
- Grand Total
- Private m_intHeaderCount As Integer
- Sub InsertRow()
- Dim intRowToInsert As Integer
- m_intHeaderCount = m_intHeaderCount + 1
- intRowToInsert = ((m_intHeaderCount - 1) * 3) + 1
- Rows(CStr(intRowToInsert) & ":" & CStr(intRowToInsert)).Select
- Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
- Range("A" & CStr(intRowToInsert + 1)).Select
- ActiveCell.FormulaR1C1 = "Column " & CStr(m_intHeaderCount)
- Range("A1").Select
- End Sub
Add Comment
Please, Sign In to add comment