Results 1 to 16 of 16

Insert rows below based on specific criteria

Threaded View

Gordon85 Insert rows below based on... 02-16-2021, 01:03 PM
MarvinP Re: Insert rows below based... 02-16-2021, 02:05 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 02:11 PM
Ochimus Re: Insert rows below based... 02-16-2021, 02:50 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 02:57 PM
Ochimus Re: Insert rows below based... 02-16-2021, 03:05 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 03:15 PM
Ochimus Re: Insert rows below based... 02-16-2021, 03:55 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 04:00 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 05:08 PM
Ochimus Re: Insert rows below based... 02-16-2021, 06:12 PM
Ochimus Re: Insert rows below based... 02-16-2021, 06:35 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 06:48 PM
Ochimus Re: Insert rows below based... 02-16-2021, 07:11 PM
Gordon85 Re: Insert rows below based... 02-16-2021, 07:45 PM
Ochimus Re: Insert rows below based... 02-16-2021, 08:15 PM
  1. #1
    Registered User
    Join Date
    01-30-2020
    Location
    Planet Earth
    MS-Off Ver
    2016
    Posts
    96

    Insert rows below based on specific criteria

    Hi

    I have this Excel file (please see below, with my attempt included).
    What is not highlighted is the input data and what is highlighted in green is the expected output, but I am not getting it right. This is just a prototype, an example, as in the main actual files I have a dozen of such entries.

    Basically I have to make sure that it inserts new rows below the first row of each section. By section I mean the zone on column A that corresponds to the same Car Name.

    The condition would be to insert rows below the 1st one of each section, copy the one above it and change just columns B and C, as the year and months should decrease until they reach the start date, as it can be seen in the picture below (please note that the "so on", was used to explain how the trend should be until it reaches the last row that should be inserted by VBA).

    This has to be done for multiple car names, so I tried doing it with a for loop but I got stuck.

    To sum it up, the condition is that it has to be within the same section (car name) then below the 1st row to insert within the section to insert multiple rows by copying the one above it and change just columns B and C (year, respectively the month) until the end date = start date on the last added row, then stop adding rows on the specific section and move on to the next one.

    Any support would be greatly appreciated!


    Gordon
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Gordon85; 02-16-2021 at 01:16 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How To Insert A Row After Specific Criteria
    By PaddyP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2020, 08:16 AM
  2. [SOLVED] Match Record based on criteria and insert in specific cell on 2nd sheet
    By scouse13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2020, 03:43 PM
  3. Insert rows to the top of the sheet that meet specific criteria.
    By unmasked_crusader in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-09-2019, 09:35 PM
  4. [SOLVED] VBA code to insert line break within a cell if specific criteria is met.
    By pipoliveira in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2018, 09:28 AM
  5. Calculate subtotals based on specific criteria + put in specific order
    By msls09 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 12:47 AM
  6. HELP! Macro to Copy specific cells from one sheet to another based on specific criteria
    By atriscritti in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2012, 11:05 AM
  7. Macro to insert data in specific cell based on criteria
    By SAsplin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2011, 08:08 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