Results 1 to 6 of 6

Insert Row after data entry

Threaded View

  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    24

    Unhappy Insert Row after data entry

    What I Want to do is the following:

    In the Sheet "Bob"
    When I make a change in a cell value in collumn C (say C4)
    I would like to insert a row under the active cell (in this case row 4)
    and copy the formulas and formating (border and colors)the row where i made the change (in this case row 4) (or I could have a copy of the formulas in row 4, copy that row and insert in the row under 4)... this way Row 5 will be empty

    Then I would like C4 to be the active cell

    The values of column C is derived and data validated form a list. The point is if I change the value in a cell in column C from blank, to say "Shoe", it inserts a row below and copy the formulas from the "Shoe-row" to the this. If I Change "Shoe" to say "Cat"... the above still should apply. The whole point is to expand an account as I enter values in column C.

    All the data (formulas) in the cells are easy If-then statements, like:
    =IF(ISERROR(IF(Settings!H7="Nn";0;Oppsett!D8*Account!E14));"";(IF(Settings!H7="No";0;Oppsett!D8*Account!E14)))


    The values of column C is derived and data validated form a list. The point is if I change the value in a cell in column C from blank, to say "Shoe", it inserts a row below and copy the formulas from the "Shoe-row" to the this. If I Change "Shoe" to say "Cat"... the above still should apply

    I´ve tried this:

    ___________
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("C:C")) Is Nothing Then
    ActiveCell.Offset(1).EntireRow.Insert
    Rows(ActiveCell.Row).Select
    Sheets("Oppsett").Select
    
    Rows(44).EntireRow.Select
    
    ActiveSheet.Paste
    
    End If
    End Sub
    _____________


    "
    I put the row with the data of interest in the worksheet "Oppsett", However, excel freezes up.


    I´ve tried this as well:


    _____________
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("C:C")) Is Nothing Then
    
    
    ActiveSheet.Range("a65536").End(xlUp).EntireRow.Copy
    ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormats
    ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormulas
    Application.CutCopyMode = False
    
    
    End If
    End Sub
    ________

    The vba freezes at the line:
    ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).EntireRow.PasteSpecial Paste:=xlPasteFormulas


    By the way
    I´ve used this formula to timestamp the entries from the C column eg:
    =IF(C14<>"";IF(B14="";TODAY();B14);"") and in the settings set maximum iteration to 1...


    Help would be much appreciated!

    Regards
    Last edited by Peltz; 11-11-2013 at 05:06 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Easy Question but I feel stupid.
    By Sunday33 in forum Excel General
    Replies: 6
    Last Post: 09-14-2013, 03:58 PM
  2. Easy lookup question - I.R.Stupid
    By BrakZak in forum Excel General
    Replies: 2
    Last Post: 03-06-2007, 05:50 AM
  3. Is there a user easy way to change the active sheet name
    By Brad Withrow in forum Excel General
    Replies: 1
    Last Post: 04-11-2006, 12:30 AM
  4. new user with easy question? not easy for me
    By speakeztruth in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-03-2005, 05:05 PM
  5. User Defined Functions - Help Text - Make it Easy for the User
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2005, 06:06 AM

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