+ Reply to Thread
Results 1 to 7 of 7

Adding a New Row every other Row (Thank You!!)

  1. #1
    Registered User
    Join Date
    02-05-2010
    Location
    California, USA
    MS-Off Ver
    Excel X for Mac
    Posts
    17

    Talking Adding a New Row every other Row (Thank You!!)

    I have imported a spreadsheet from our district's grade-keeping site. I want to insert a new row between every student and would like to find a way to do it without having to do it manually for each of every 700+ students. This row can be blank, but if there is a way to enter a copied row of information, that would be better.

    I tried to write a Macro, but it only adds the new row at the same place each time.

    Thank you for taking the time to help an old teacher.

    Cheers
    Last edited by Bantymom; 02-09-2010 at 04:17 PM.
    If the world were logical, men would ride sidesaddle. --- Rita Mae Brown

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Adding a New Row every other Row

    Well, always happy to help a teacher. However it is hard to help you with your second request because you didn't provide information about where your 'mystery' row of data is located. Anyway, this will add a row between every row in your sheet.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-05-2010
    Location
    California, USA
    MS-Off Ver
    Excel X for Mac
    Posts
    17

    Re: Adding a New Row every other Row

    Mallycat, thank you!

    I think I figured it out. I began a new macro and saved it, then opened and edited in the code you wrote for me. I changed the start place from A1 to A4 and then ran it and it worked very nicely then.

    As for the second part of my question, the "mystery" row of data is row 1 (above my titles). If you can tell me how to add that into the code, I would be even more appreciative!

    Thank you again!
    Last edited by Bantymom; 02-05-2010 at 03:30 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Adding a New Row every other Row

    OK, here is your code

    Please Login or Register  to view this content.
    What you need to do is this.

    1. Copy From Range: replace A2:G2 in the above code to be the exact range you want to copy FROM.

    2. Copy To Range: Replace A1:G1 to a horizontal strip the same size as you copy from range. So if your copy from range is 4 cells wide, then replace A1:G1 with A1:D1

    Does that make sense?

    Here is the explanation why. The copy from range uses the top left corner cell (Cell A1) as the reference. You can therefore refer to it with the normal address. The copy to range is using the active cell as the point of reference. So if the copy from range is 4 cells wide and 1 cell tall, then you need to refer to it as A1:D1, relative to the active cell.

    Hope that makes sense
    Last edited by Mallycat; 02-05-2010 at 05:11 AM.

  5. #5
    Registered User
    Join Date
    02-05-2010
    Location
    California, USA
    MS-Off Ver
    Excel X for Mac
    Posts
    17

    Re: Adding a New Row every other Row

    Yes! It Works! *does the happy dance*

    the shortcut stopped working though, and I was wondering if I can force it to keep the color and font characteristics when it pastes itself in instead of changing to the color and font of the row above it?

    Worksheet is attached

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Adding a New Row every other Row

    No problems. This requires a slightly different approach, but no worries.

    Please Login or Register  to view this content.
    The shortcut works for me. You should be able to set this in the Macro menu under options. If it looks right and it doesn't work, try rebooting your computer.
    Last edited by Mallycat; 02-05-2010 at 03:41 PM.

  7. #7
    Registered User
    Join Date
    02-05-2010
    Location
    California, USA
    MS-Off Ver
    Excel X for Mac
    Posts
    17

    Re: Adding a New Row every other Row

    Yes! it works wonderfully, AND, I figured out how to make it add two rows (copied) from above! I am soooo happy. Thank you, thank you very much for your patience with me. I feel more confident now.

    I still couldn't the short cut to work, but it doesn't matter much since the macro works through the entire sheet.

    I am marking this "solved."

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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