+ Reply to Thread
Results 1 to 6 of 6

Copy Last Row

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Copy Last Row

    On the attached example sheet, I have a table of data which the user constantly adds to the next available row. Although, when adding data to the next row the data in some of the columns are going to be the same as the row above. So, I want to make it less tedious filling in these columns for new rows.

    I have attached a command button to the top of the worksheet which loads a form. The form has a series of checkboxes relating to certain columns in the table to give the user the choice of which columns top copy down and a text to enter how many rows to copy the last row down.

    Any idea how to code?
    Attached Files Attached Files
    Last edited by adam2308; 10-13-2012 at 07:58 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Last Row

    So will they enter in the data in a few cells of a particular row and then click the button to fill up the rest of the columns?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Copy Last Row

    Hi adam2308,

    Try this:

    Please Login or Register  to view this content.
    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Copy Last Row

    Yes Arlu, that is correct. Trebor is on the right track, the only omission in his code is that it only copies down one row. The number of rows that it copies down should be determinded by TextBox1 in the userform. At the moment I can't see any use of this textbox value in CommandButton2 code.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Copy Last Row

    See how this goes:

    Please Login or Register  to view this content.
    Robert

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Copy Last Row

    That's perfect. Thanks Robert!

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Copy Last Row

    Thanks for letting us know and you're welcome.

+ 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