Closed Thread
Results 1 to 6 of 6

Copying specific cells from one worksheet to another

  1. #1
    Registered User
    Join Date
    08-04-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    8

    Question Copying specific cells from one worksheet to another

    Hi,

    I'm hoping someone can help. I have created a workbook with two sheets. A sheet named "Invoice" and another named "Sales Summary Sheet" (SSS).

    After clicking on a button (on the Invoice sheet), data in specific cells get copied to specific cells in SSS.

    I want to copy row(s) depending on how many rows are entered into the Invoice template, to the SSS sheet. Currently rows A19:H19, A20:H20, A21:H21...to A32:H32 are rows that can have potential data in it that need to be copied to rows in the SSS sheet.

    For every row in the Invoice sheet, I need to copy the data to a new row in the SSS sheet (and not overwrite existing rows of data in the SSS sheet). So for example row A19:A32 need to be copied to A2:O2, and if data in B19:B32 exists , then it also needs to be copied to A3:O3.

    Once SSS is saved, the next time I open Invoice and re-enter data into A19:A32, it will add the data into SSS in cells A4:O4.

    Right now I have this current code:

    Please Login or Register  to view this content.

    When I run the above code, it only copies row A19:H19 in the Invoice sheet to row A2:O2 in SSS, and DOES NOT copy the second (third, fourth...) row of data to SSS.

    Please see attachments to see what the Invoice (before) and SSS sheet (after) should look like.

    Any help would be GREATLY APPRECIATED!

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Copying specific cells from one worksheet to another

    I think the LastRow variable is poiting to the wrong cell. Try changing this:
    Please Login or Register  to view this content.
    to:

    Please Login or Register  to view this content.
    Let me know if that helps.

  3. #3
    Registered User
    Join Date
    08-04-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copying specific cells from one worksheet to another

    Hi,

    I tried to change up the code like you suggested and unfortunately, it still isn't copying data from the second row in the Invoice table to the SSS sheet.

    Thanks for your effort.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copying specific cells from one worksheet to another

    Hi DazedConfuzed

    If you wish to have code that's been tested...pdf files are of no help. Please post a sanitized (confidential/personal info removed) workbook that reflects your actual file.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    08-04-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copying specific cells from one worksheet to another

    I am attaching a mock workbook with hopes that someone may have a solution to my problem. I appreciate all the help offered.

    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Copying specific cells from one worksheet to another

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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