+ Reply to Thread
Results 1 to 12 of 12

Insert rows between rows in my selection

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Insert rows between rows in my selection

    I worked on creating the macro below about a year ago, and am now having to revisit it. The goal is to insert a number of blank rows between the existing filled rows in your selection. It works beautifully, EXCEPT that it operates on the whole sheet, not just the selection, and I'm stymied on how to fix it. Any help is appreciated.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Insert rows between rows in my selection

    Please Login or Register  to view this content.
    e/ sorry I missed an L
    Last edited by Solus Rankin; 11-25-2013 at 06:21 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Re: Insert rows between rows in my selection

    Solus,

    Please accept my apologies; I posted a reply on the 25th, then went on vacation, and am just now getting back and see that my post didn't post!

    i tried your version, and still have the same issue; even though I select, for instance, A17:D35, the entire worksheet is affected by the macro. The desired result for the selection above would be to insert the requisite rows in the range beginning at row 17 trhough the current row 35.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Re: Insert rows between rows in my selection

    Bumping up, still in need of a solution.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert rows between rows in my selection

    Here's a different approach:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert rows between rows in my selection

    Quote Originally Posted by JOHN H. DAVIS View Post
    Here's a different approach:

    Please Login or Register  to view this content.
    Sorry this won't work didn't read your thread carefully.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert rows between rows in my selection

    This may though;

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Re: Insert rows between rows in my selection

    Holy Smokes! You did it! I love new approaches. I would have never thought of the "Do Until x = 0" approach, but now that you've shown me it's so apparent. Thanks so much!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert rows between rows in my selection

    You're welcome. Glad to help out and thanks for the feedback and the reps.

  10. #10
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows between rows in my selection

    wow, I have been looking the whole day for something like this.

    but I need one mre step. I want 2 rows copied but the second row is a locked formated row.

    I want to keep the formating

    Please help

    Thanks
    Aneshree

  11. #11
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Re: Insert rows between rows in my selection

    Aneshree,

    It's considered bad form by some to post a new request in an old thread. You'd get better results by creating a new thread, and maybe including a reference back to this thread. I think you'll get more help that way.

    John

  12. #12
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows between rows in my selection

    sorry. John. I was so excited when I found 90% of the answer.

    I will start a new thread.

    Thanks
    Aneshree

+ 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] Random selection of Rows and date Insert
    By Notorious543 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2013, 01:15 PM
  2. [SOLVED] Selection.EntireRow.Insert Inserts too many Rows!
    By nickv02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2012, 11:40 AM
  3. Macro- delete 2 adjacent rows, insert counta and average functions of selection
    By drudixon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2010, 11:27 PM
  4. Macro to insert rows based on user selection Options??
    By mike.magill in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2010, 06:23 PM
  5. Macro to insert blank rows b/t a specific selection
    By VTdude12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2009, 11:54 AM

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