Excel VBA - Insert Row

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
 
D

duane

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top