Autoatically insert blank row above total when no more rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI,

I am trying to make a budget woorksheet and i am wondering how i would set
excel up to do the following:

when information is entered into the last blank row above the row containing
the "total" cells

- a blank row is inserted above the "total" row.

this would enable me to keep the budget sheet as compact as possible, by not
having to leave a lot of blank lines, or keep inserting them.

Thank you!!
 
Why not put your total in the next column and use sum(A:A)? otherwise:
insert this into the worksheet code for which you "Total" calculation
is in. Also you must name the cell containing the "Total" Calculation
to "Total"
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Cells(Range("Total").Row - 1,
Range("Total").Column).Address Then
If Target.Value <> "" Then
Rows(Target.Row + 1).EntireRow.Insert shift:=xlDown
End If
End If
End Sub

HTH

Die_Another_Day
 
Thanks for the code, but it wont compile. I dont know enough about VB to
figure out what the errors are, but i think it is a combination of the IF
Then Structures and missing parenthesis.
 
Back
Top