+ Reply to Thread
Results 1 to 8 of 8

Copy rows to different sheet starting at a specific row

  1. #1
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,816

    Copy rows to different sheet starting at a specific row

    I am having a little mental block (old age) finding a solution to this problem. I use the following code to copy entire rows from one sheet to another and this is pretty standard.
    Please Login or Register  to view this content.
    Assuming that Sheet2 is blank, this of course copies the rows to Sheet2 starting at Cell A2 and down column A. I would like to modify the code so that I can specify at which row the copy should start. For example, I might want to start the copy at A1 instead of A2, or at A10 instead of A2. I should mention that I will be copying mulptile rows so they should all be copied below each other. Any help would be greatly appreciated.

    Also posted at: http://www.ozgrid.com/forum/showthre...goto=newpost**

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy rows to different sheet starting at a specific row

    One way

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,816

    Re: Copy rows to different sheet starting at a specific row

    Thank you so much for your quick reply, AB33. This is my original code but I want to start the copy at row 1 on Sheet 2.
    Please Login or Register  to view this content.
    I modified it following your suggestion so it looks like this:
    Please Login or Register  to view this content.
    but I get an 'Application-defined or Object-defined' error on line:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,816

    Re: Copy rows to different sheet starting at a specific row

    My apologies, AB33. I realized a made a typo, RN instead of NR. I fixed it and your suggestion works perfectly. Many thanks, once again.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy rows to different sheet starting at a specific row

    Mumps1,
    You are welcome!

  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: Copy rows to different sheet starting at a specific row

    This may not be the best way, but I've used it before. If there is no data above. Have an inputbox to ask for a start row. Then: Sheets("Sheet2").Range("A" & startrow).value = " ". Then run your code.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,816

    Re: Copy rows to different sheet starting at a specific row

    Many thanks to you as well, John. I appreciate your suggestion very much.

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

    Re: Copy rows to different sheet starting at a specific row

    You're welcome. Always glad to help and too learn. I did make a mistake in explanation, but the sample seems to clearify what I meant.

+ 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