+ Reply to Thread
Results 1 to 4 of 4

Insert multiple rows based on a criteria

  1. #1
    Registered User
    Join Date
    02-21-2018
    Location
    England
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    15

    Question Insert multiple rows based on a criteria

    Hi all,

    Before I begin, please note I have never used VBA before

    Essentially the title says it all, I have a big excel file with about 10k rows, and I need to insert rows at given points throughout the sheet. I have introduced a helper column that I use to delete rows (a simple logical check that returns true or false, then I filter by true values and delete those rows) and I wish to tweak this helper column to return true when the criteria is met for a row that I wish to insert a line ABOVE. However I have no idea how to implement this.

    Can someone provide some simple VBA code that does something like the following:
    Please Login or Register  to view this content.
    Something like that, I know its not VBA code but I made it as generic as possible

    Thank you!
    Last edited by acenewbie; 05-16-2018 at 08:22 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: Insert multiple rows based on a criteria

    Try such code:

    Please Login or Register  to view this content.
    substitute "B" with column where your criteria formula is.
    (I used not 10000 but last entry in column A as a reference of rows to be examined)
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    02-21-2018
    Location
    England
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    15

    Re: Insert multiple rows based on a criteria

    Hi Kaper,

    That does the trick perfectly. I need to put some effort into learning VBA but I am still in the process of learning Java. Many thanks for your simple answer to my question!

    Kind Regards

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: Insert multiple rows based on a criteria

    Glad to hear so and thanks for marking thread SOLVED and for reputation point :-)

+ 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. [SOLVED] Insert a name/value based on multiple criteria
    By fotodude in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-05-2017, 05:50 PM
  2. VBA Macro to insert rows based on criteria
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2014, 11:16 AM
  3. [SOLVED] Insert rows and enter data based on day and time criteria
    By kenzer2060 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2013, 10:09 AM
  4. Replies: 1
    Last Post: 01-30-2013, 12:12 PM
  5. [SOLVED] Insert Multiple Rows Based Off Number in Cell and Copy Data From Above New Rows
    By tstell1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 04:15 PM
  6. [SOLVED] Excel 07 - Macro to insert rows based on criteria
    By smic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2012, 09:58 AM
  7. insert copied rows with multiple criteria
    By klng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2008, 08:27 PM

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