Excel VBA - Insert Row

  • Thread starter Thread starter bforster1
  • Start date Start date
B

bforster1

I have a financial statement spreadsheet and would like the user to b
able to expand the revenue sub categories for each client.

Month 1 Month 2
Month3......
Revenue
Revenue #1 [boarders] ......
Revenue #2 [boarders] ......
Total Revenue

There are boarders in each cell for the periods to the right of eac
revenue line item. I am looking for code that would cause the progra
to go to the last sub row (Revenue #2 in the example above) and the
insert a row below as well as the formatting to the right. Right now
am using the following code but it does not put the row below the las
sub category and the formatting does not copy down.

Sub Macro4()
Range("B11").Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Selection.EntireRow.Insert
End Sub

Thanks in advanc
 
I'm not great at doing this off the cuff but try this

Sub Macro4()
Range("B11").End(xlDown).Select
cells(activecell.row-1, activecell.column).select
Selection.EntireRow.Insert
End Su
 
Back
Top