+ Reply to Thread
Results 1 to 4 of 4

Autoatically insert blank row above total when no more rows

  1. #1
    Capsaisin
    Guest

    Autoatically insert blank row above total when no more rows

    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!!

  2. #2
    Die_Another_Day
    Guest

    Re: Autoatically insert blank row above total when no more rows

    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


  3. #3
    Capsaisin
    Guest

    Re: Autoatically insert blank row above total when no more rows

    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.

    "Die_Another_Day" wrote:

    > 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
    >
    >


  4. #4
    Don Guillett
    Guest

    Re: Autoatically insert blank row above total when no more rows

    See my answer in .misc and please post in ONE group only.

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Capsaisin" <[email protected]> wrote in message
    news:[email protected]...
    > 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!!




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1