+ Reply to Thread
Results 1 to 3 of 3

Insert number of user inputted rows without copying pre-existing data

  1. #1
    Registered User
    Join Date
    09-19-2014
    Location
    Philadelphia,PA
    MS-Off Ver
    2010
    Posts
    54

    Insert number of user inputted rows without copying pre-existing data

    Hi all,

    I have a formula that pastes rows into the excel sheet based on how many rows the user wants. However, it copies over pre-existing data.

    Can anyone modify this VBA so it shifts all of the rows down?
    Additionally, is it possible to copy the previous row and paste it instead of inserting new rows?

    Please Login or Register  to view this content.

    Thanks for the help!

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Insert number of user inputted rows without copying pre-existing data

    the best way to learn VBA is to record macros, set a macro recording and then do what you want to do, for instance highlight the number of rows you want to insert, right click, select Insert and answer any questions that come up.

    Then stop the macro, go into VBA and a new module should exist that will hold all the code from your actions. That way you can get it to do exactly what you want and see the exact code that does it. The simply lift the bit(s) that are relevant and modify them for variables etc in your code.

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

    Re: Insert number of user inputted rows without copying pre-existing data

    works for me as is.

+ 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] Insert User Selected Number of Blank Rows
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2012, 12:33 PM
  2. Replies: 3
    Last Post: 08-16-2012, 01:31 AM
  3. Insert Number After Existing Data?
    By Mick2011 in forum Excel General
    Replies: 3
    Last Post: 11-30-2011, 03:30 AM
  4. Insert rows between existing data
    By Tickla in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2010, 03:30 AM
  5. Summing all rows in a user inputted column
    By NukedWhale in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2009, 07:34 PM

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