+ Reply to Thread
Results 1 to 6 of 6

How to Copy by Each Row not Overall, how's the logic?

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Surabaya, Indonesia
    MS-Off Ver
    MS 365 (Windows 11 64-bit)
    Posts
    84

    How to Copy by Each Row not Overall, how's the logic?

    Hi,

    I have this condition. user define which data will be copied, by typing "YES", after typing it all, they'll push button "Input to database"

    It's seem similar to my previous post http://www.excelforum.com/excel-gene...ml#post4305711

    but it's totally different case.

    the data will be copy & paste to designated table in other sheet. currently it copy by overall, here's the screenshot, code, and file

    is there a way, to copy only row 10 & 14 to be paste into the table?

    file download Copy based on condition with random row.xlsm

    user defined which data will be copied... by type Yes, column I-L = B-E. and when user click input to database, data in I-L will be copy & paste to sheet Table.
    NOTES : it must going through I-L first. and copy data from I-L, not B-E

    Capture.JPG

    the current result, K3 failed to detect the last FALSE in H14, because its just detect the first one.

    tableResult.JPG

    my code.... which copy data from I-L to Sheet Table

    Please Login or Register  to view this content.
    Last edited by radian89; 02-03-2016 at 06:49 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: How to Copy by Each Row not Overall, how's the logic?

    You don't have to use 3rd party file uploads, use this forums uploader.

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.

  3. #3
    Registered User
    Join Date
    11-12-2015
    Location
    Surabaya, Indonesia
    MS-Off Ver
    MS 365 (Windows 11 64-bit)
    Posts
    84

    Re: How to Copy by Each Row not Overall, how's the logic?

    Quote Originally Posted by davesexcel View Post
    You don't have to use 3rd party file uploads, use this forums uploader.

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.
    Hi DavesExcel,

    Thanks a lot for helping me... I've add the attachment in my first post, and

    Here's my current code do after user click input database, it will copy cells (within red square)

    CurrentCodeCopy.JPG CurrenttableResult.JPG


    My expected result is, it will copy each red square, wherever the data checker say FALSE

    expectedCodeCopy.JPG ExpectedtableResult.JPG

    How to write the code then?

    thanks so much for looking this case
    Warm regards,

    Adrian
    Last edited by radian89; 02-03-2016 at 07:03 AM.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: How to Copy by Each Row not Overall, how's the logic?

    In order for this to work correctly, you will have to make sure the table and last row are the same.

    2-3-2016 6-07-37 AM.jpg

    Run the code
    Please Login or Register  to view this content.
    The result ,

    2-3-2016 6-08-19 AM.jpg

    Find attached workbook
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-12-2015
    Location
    Surabaya, Indonesia
    MS-Off Ver
    MS 365 (Windows 11 64-bit)
    Posts
    84

    Re: How to Copy by Each Row not Overall, how's the logic?

    Quote Originally Posted by davesexcel View Post
    In order for this to work correctly, you will have to make sure the table and last row are the same.

    Attachment 444383

    Run the code
    Please Login or Register  to view this content.
    The result ,

    Attachment 444385

    Find attached workbook
    Hi DavesExcel,

    thanks so much for the reply... it solved the problem, but would you mind to explain
    you will have to make sure the table and last row are the same
    I'm trying to learn your code..

    thanks again
    warm regards,

    Adrian

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: How to Copy by Each Row not Overall, how's the logic?

    You don't have to quote the entire previous post, it just clutters your thread.

    When finding the last row, if a table is involved, the code will find the last row of the table, not the last row that has a value in it. I just wanted to make sure you had no empty rows in your table.

+ 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] Modify a column of data with a logic argument, copy paste down etc..
    By D.Lovell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2015, 02:22 PM
  2. Simple copy pest data with logic
    By arindamsenaxa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-12-2015, 02:29 AM
  3. Adding If / Then Logic to a Copy / Paste VBA Macro
    By levitt in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-06-2014, 01:29 AM
  4. VBA code for copy/paste logic needed
    By overlook1977 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2008, 10:20 PM
  5. [SOLVED] Simple Copy-Paste logic not working
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2005, 02:40 PM
  6. hpw do I logic test a cell then copy the row to diff. SS
    By Debi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-05-2005, 05:05 PM
  7. copy macro with if logic?
    By copyright2000 in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 03-17-2005, 10:12 PM

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