+ Reply to Thread
Results 1 to 13 of 13

Automatic insert row if cell above contains text or else

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Thumbs up Automatic insert row if cell above contains text or else

    Hello everyone,

    This is a great forum. A good help for me.
    But i have a new problem that can't be solved by me.

    With "sheet1" there's a table c14:m38 with all formulas. But i want to expand the table if cell c38 contains a value or text.

    Is it possible to automaticly insert a row containing the above formulas in row c14:m14??

    Please help.

    Thanks to you all.
    Last edited by trijn; 08-19-2014 at 03:15 PM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Automatic insert row if cell above contains text or else

    Just record yourself draggin the row down and look at that code, the formulas will be copied from the row above.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Automatic insert row if cell above contains text or else

    If the "table" is actually a Table, it should automatically extend the range to include the new row as soon as you enter text in the cell. It will copy formulae, formatting, Conditional Formatting and Data Validation.

    Suggest you post a sample workbook.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else

    hello,

    It's not actually an table but a range.

  5. #5
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else


  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Automatic insert row if cell above contains text or else

    Is that a true representation of your live workbook/worksheet?

    I had a problem opening it (it needed repairing for some reason) and the formulae you have give circular reference errors

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Without dwelling on it too much, you could either follow Nathan's advice and record a macro. This could perhaps be fired on a Selection Change. Or yo could convert the data into a "true" Table ... which I suspect would be a lot easier.

    Regards, TMS

  7. #7
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else

    Book1.xlsx

    I think this one will work.

    Thanks

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Automatic insert row if cell above contains text or else

    See the updated workbook.

    Regards, TMS
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else

    Thanks for your time. This is just what i needed.
    Is there also a possibility to delete de rows you don't need. For example the table listed 20 rows. I only 10 rows filled with text. The blank rows i needs to be deleted.

    Regards,

    Theo

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Automatic insert row if cell above contains text or else

    Not sure where the blank rows are. I didn't think there were any in the sample I uploaded.

    Whatever, just select the whole rows and delete them with the Delete icon on the Robbon, not the delete key.

    Regards, TMS

  11. #11
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else

    Now i'm a little further in making my database. Only now i'm facing a problem with selecting a range en copy this in sheet3. I want to select the range without cells containing "FALSE". Is there a possibility to do this. by using specialcells xl logical or something. Table has to be the same size.

    Thanks..Book2.xlsx

  12. #12
    Registered User
    Join Date
    08-06-2014
    Location
    holland
    MS-Off Ver
    2010
    Posts
    10

    Re: Automatic insert row if cell above contains text or else

    I found a simple solution by using autofilter within a table and then copy paste.


    Topic "SOLVED"

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Automatic insert row if cell above contains text or else

    Ah, good. I'm glad you have found a solution.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 03-28-2014, 07:04 AM
  2. [SOLVED] VBA Codes who insert the automatic worksheet when click a cell and all datas of its
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2013, 03:32 AM
  3. Insert automatic date and time stamp in a cell if any cell of the same row is edited
    By kdhanerawala in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-12-2012, 06:18 PM
  4. VBA code to insert formula with automatic cell referencing & size
    By vbatech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2012, 04:32 AM
  5. Replies: 4
    Last Post: 06-01-2009, 02:29 AM

Tags for this Thread

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