+ Reply to Thread
Results 1 to 3 of 3

Automatically Insert Row when data entered into cell

  1. #1
    Registered User
    Join Date
    06-02-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    2

    Automatically Insert Row when data entered into cell

    A lot of the other examples I've seen of this have been too complex...

    I am making a spreadsheet to track expenses across a number of areas... When a user enters an expense (enters the item name in a cell), I want excel to automatically insert a new row so that they can enter another item. So basically in pseudo:


    If the row above has data, insert one new row


    I tried the following code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Row = [OfficeItems].Row - 1 Then
    [OfficeItems].EntireRow.Insert
    End If
    End Sub


    But it seems to loop repeatedly then excel hangs.



    I've attached the file, sans code, the named cell "OfficeItems" in this example is A4.

    Please help, Thanks in Advance!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Automatically Insert Row when data entered into cell

    Try something like this...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-02-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Automatically Insert Row when data entered into cell

    Works a treat!

    Thank you so much

+ 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