+ Reply to Thread
Results 1 to 12 of 12

copy certain cells in target row to bottom of list

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    copy certain cells in target row to bottom of list

    Hi, I need a bit of help, need code when I click on a cell, then certain cells in the target row are copied and pasted to the bottom of a list and yes, this has merged cells, sorry. So in the screenshot, if you click on the yellow cell I want the green cells copied to the bottom of the list. I have also attached a sample workbook. Thanks.Copy_bottom.PNG
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    I remembered I had a similar code, so I tried to alter it but it keeps stopping with this 1004 error and I am not sure what is wrong. Can someone help? Attached is workbook with the code. Maybe it doesn't work well with merged cells? it breaks on the last line, Sheet1.Cells(16,-6)...Thanks.
    1004.PNG
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by thecdnmole; 01-13-2019 at 09:57 AM.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy certain cells in target row to bottom of list

    How about this.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    Awesome bakerman2! Thanks a lot!!

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy certain cells in target row to bottom of list

    Glad to help and thanks for rep+.

  6. #6
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    I hate to do this as I can usually figure out the code once I have a start like bakerman2 provided, but I just can't get it to work on my worksheet. So if someone can help? If you doubleclick on a cell in column S, then cells from column B to O are to be copied in the next available row. Thanks.
    Attached Files Attached Files
    Last edited by thecdnmole; 01-13-2019 at 12:06 AM.

  7. #7
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    Ok, I've got it working, but I also want to copy the cell in column AB, which was working and now isn't. Anyone?
    Please Login or Register  to view this content.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy certain cells in target row to bottom of list

    Please Login or Register  to view this content.
    The second argument of Cells is ColumnNumber so this can never be negative.
    Please Login or Register  to view this content.
    This copies columns B:O to first empty cell in column B so this is correct.
    Please Login or Register  to view this content.
    This copies column AB value, but also to first empty cell in column B. ???

  9. #9
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    Thanks for the clarification bakerman2. I want to copy the cell in column AB to the same line as where the other cells B:O are being copied to, so I want B:O & AB in this case.

  10. #10
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    Slept on the problem and figured it out this morning!
    Please Login or Register  to view this content.
    Thanks again bakerman2!

  11. #11
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    I am puzzled, in the example workbook I provided here (multiple_hose2) cell A29 which is a large merged cell is empty as it contains sensitive information. The code bakerman2 provided works great in the example workbook, but when I add the data back into A29, it doesn't work. Can someone explain why this is the case and is there a way to make it work? Thanks.

  12. #12
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: copy certain cells in target row to bottom of list

    I think I know what the problem is, in the example provide here, none of the cells in the form have formulas, whereas in my working sheet, there is formulas in 90% of the cells. Is there a way to make it work because of this?

+ 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] Copy cell down to bottom of adjacent variable list
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2017, 07:12 AM
  2. [SOLVED] Copy List of Hyperlinked Files From Source to Target Folder
    By ugadawgs311 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-01-2014, 03:21 AM
  3. Copy Cells and paste to the bottom of the list in another workbook
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-20-2014, 12:58 PM
  4. Help needed VBA Copy select cells and add to bottom of list.
    By thequiff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2013, 07:54 AM
  5. Copy cells at the bottom of a page as well as the top
    By danellis in forum Excel General
    Replies: 3
    Last Post: 12-18-2011, 03:45 PM
  6. Code to copy data from one column and paste in at the bottom of another list
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2011, 10:20 PM
  7. Sort list and put blank cells to bottom
    By JamesT1 in forum Excel General
    Replies: 2
    Last Post: 05-19-2011, 11:27 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