+ Reply to Thread
Results 1 to 19 of 19

Append Data

  1. #1
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Append Data

    Hello does anyone know why some of the rows of data are skipped when running this macro?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Append Data

    Can you give a description of what you are expecting this code to do, and specifically what you mean by "some of the rows of data are skipped"?

    The use of multiple lines of code on a single line and GoTo statements make this code a bit obfuscated and are not considered good coding practices. This makes the code more difficult to analyze for functionality and bugs. I would rewrite the code like this, which I think is logically equivalent, but I'm not 100% sure what you want it to do:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    Thanks for replying. I want the code to copy rows to the correct month based on the 'Date In'.

    I appreciate any help or suggestions.

  4. #4
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    This is the workbook and it shows in JAN sheet how some of the rows are skipped.

    Thanks Jeff
    Attached Files Attached Files

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Append Data

    I didn't try to patch your existing code, I just rewrote it. Also, I recommend you use Option Explicit to guarantee that all variables are declared.
    Attached Files Attached Files

  6. #6
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    The rows are duplicated with different IDs if selected again. Data will be entered on the Master sheet daily so if can tweak it to avoid duplicates I appreciate it. The ID numbers are meant to stay with the row records please.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    This works if the ID's are unique and sequential:

    Please Login or Register  to view this content.
    @ Jeff - Sorry you don't like my code
    Last edited by xladept; 12-22-2017 at 02:07 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  8. #8
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    I tried it thanks but if I click again it duplicates. Is there a way to prevent the rows that have been appended to not append again? I really appreciate the help.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Append Data

    This resolves it.
    Please Login or Register  to view this content.

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    If the value in Column C is unique then this will work:

    Please Login or Register  to view this content.
    * The column 1 entry on the master doesn't read

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    @ Jeff - Interesting that we both used the finder to eliminate duplication

  12. #12
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    Thanks guys for the codes but both go to debugger. Could you try them to see if it's something I'm doing wrong?

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    This now works for unique ID's:

    Please Login or Register  to view this content.
    Last edited by xladept; 12-22-2017 at 02:51 PM.

  14. #14
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    Very close it misses the first 2 rows and the 5th row.

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    Try it again - I just edited it

  16. #16
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    Perfect! Thank you so much for the fantastic support.

    Merry Christmas and Happy New Year

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Append Data

    Merry Christmas and thanks for the rep!

  18. #18
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Append Data

    Here is my version implemented in your file, I didn't have a problem with it.
    Attached Files Attached Files

  19. #19
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Append Data

    Thank you too Jeff for the help.

+ 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] Attemting to take a column of data and append it to multiple rows of data on another sheet
    By JamesJohnson31 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2016, 10:34 AM
  2. Import & append data from web
    By ajit.nayak87 in forum Excel General
    Replies: 0
    Last Post: 09-07-2015, 04:51 AM
  3. Append data and summary
    By Bhagwant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2014, 01:12 PM
  4. [SOLVED] Move Data to another Sheet append to bottom of list and create a CSV of data
    By thequiff in forum Excel Programming / VBA / Macros
    Replies: 41
    Last Post: 07-26-2012, 06:38 AM
  5. Replies: 0
    Last Post: 07-18-2012, 03:45 AM
  6. Append data from WS2 to WS1
    By spk1009 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2012, 11:34 AM
  7. append data
    By jam0678 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2006, 07:48 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