+ Reply to Thread
Results 1 to 6 of 6

Macro to automatically insert rows between changes in data

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro to automatically insert rows between changes in data

    Hi All,

    I am extremely new to macros, but I think using one for this purpose would save me a great deal of time. I am using Excel 2010 on Windows 7. Here is an example of the data that i have in my worksheet:

    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- MISCELLANEOUS - 11501170
    El Paso Live Events- STREETFEST - 11501179
    El Paso Live Events- STREETFEST - 11501179
    El Paso Live Events- STREETFEST - 11501179
    El Paso Live Events- MEXICAN COOK OFF - 11501181
    El Paso Live Events- MEXICAN COOK OFF - 11501181
    El Paso Live Events- MEXICAN COOK OFF - 11501181

    I would like to have the macro insert a row between each change in data. Is this possible and can anyone help with the code?

    Thank you very much in advance for your help!

    -Chris
    Last edited by JBeaucaire; 10-11-2012 at 01:35 PM. Reason: Moved to correct forum.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to automatically insert rows between changes in data

    A sample workbook would make it easy for us to see exactly what that data really looks like. It appears it is text strings, all in one cell per row?

    So, this macro will insert blank rows bu checking column A for changes:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to automatically insert rows between changes in data

    Thanks Jerry! Attached is a sample of the data I am working with...
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to automatically insert rows between changes in data

    So, you'll want to edit the macro given already here:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-11-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to automatically insert rows between changes in data

    Jerry, you are the man! You have helped me cut out 3 hours of formatting for these datasets! Thank you a million times over!!!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to automatically insert rows between changes in data

    I have marked this thread solved for you.
    In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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