1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Insert blank rows above a table based on unique values in one of the columns in the table

Discussion in 'VBA Macros' started by Carlos Ruano, Feb 7, 2019.

  1. Carlos Ruano

    Carlos Ruano Member


    First, my apologies if anything I write is unclear or if I have not provided sufficient information. I almost never have the opportunity to work with vba, so when I do get to play around with it once or twice every year or two, I come at it as an absolute newb.

    My question (with some details):

    I copied some vba from a previous macro that splits data from a table in one sheet onto several new sheets based on contents in cells of one of the columns in the original sheet. In other words, if there are three unique strings in column E, then my macro creates three new sheets with names that match the unique strings in column E in the original table, and then it copies rows of data from the original table that contain each unique string, and pastes those rows into the corresponding new sheet. This code is working perfectly (even thought I don't understand how it all works).

    What I want to happen next is, on each of the newly created sheets, I want to count the number of unique strings in column B, then insert that number of blank rows + 5 at the top of the sheet. In other words, if there are 5 unique strings in column B, then I want to insert 10 blank rows at the top of the sheet. I don't know if it matters, but the new sheets will always start at the 4th sheet (first three sheets are fixed, and will always be present). Possible names of the new sheets are, "ICO RWE", "ICO RWE-RSH", "ICO RSH", "ICR SSU", and "ICR MED", but not all sheets will always be present. For example, one workbook might only have "ICO RWE" and "ICO RSH".

    Any and all help is greatly appreciated. Please let me know if more details are needed.

    Thank you!
  2. p45cal

    p45cal Well-Known Member

    Suppy the existing code and we will tweak it to add the extra functionality.

Share This Page