+ Reply to Thread
Results 1 to 27 of 27

copy items into column across files and copy to bottom with ignore duplicate items

  1. #1
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    copy items into column across files and copy to bottom with ignore duplicate items

    hi
    the result should be in file RESULT . should create whole data with headers . the idea should bring all of the items from all files from column B but should not bring duplicate items if there are existed across files . every time should copy to the bottom when bring different items from multiple files with ignore the duplicate items .
    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Code for macro.
    NOTE: Give correct path for both the files.
    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 02-07-2022 at 09:16 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    thanks but there are some items don't show . I highlighted in column G some items are missed , also it deletes the borders and formatting when every time run the macro even if I do the formatting and borders manually the macro delete it .
    Attached Files Attached Files

  4. #4
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,360

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    If it is not a massive list then amybe bring in all data and then remove duplicates?

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    I have corrected mistakes. Formatting portion is removed. Whatever you have set remains.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @CheeseSandwich actually I attached simple data to understand my requirement . but I excpect to reach the data about 800 rows for each file
    so the question is " does your code works with about 1000 rows for each file?

  7. #7
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @kvsrinivasamurthy thanks again , but still problem continues about borders and formatting . the code doesn't make it and delete it if I make it manually .

  8. #8
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,360

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Yes should be fine with that - the code will expand its range depending on the data in the pecified files.

  9. #9
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @CheeseSandwich so I will test it and inform you how works for me .

  10. #10
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @CheeseSandwich your code works very well , but I need your help .
    first I would expand the files maybe I have more than two file I would use directory contains many files instead of specify two files
    second I would sort the items from small to big for the letters , numbers to become more arranging .

  11. #11
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,360

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    You want to sort by column B at the end?

    Please Login or Register  to view this content.
    Path is the folder where your files reside

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Try this code
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @CheeseSandwich I would ask you if there is way make the file which run the macro from it "RESULT" also it's in the same folder becuase it delete your macro and doesn't work if I put it in the same folder.

  14. #14
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @kvsrinivasamurthy nice work ! I don't waste your time if you still interest , may you see post#10,please ?

  15. #15
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Code for macro.
    In the code;
    Number files to be entered (FilesNo). I have given 2
    Enter all file names .

    Please Login or Register  to view this content.

  16. #16
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    A faster code
    Please Login or Register  to view this content.

  17. #17
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,360

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Name the workbook: Result.xlsm and put the below code in it. Put it in the folders with all of the files you wish to import and run it.

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    all of things are great !
    many thanks guys for your time and help .

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Different method.
    Please Login or Register  to view this content.

  20. #20
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @jindon this is very excellent ! just it misses the sort from small to big as in codes of the others guys
    thanks very much

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Are you happy with such sort?
    Built in Sort function can not sort as you mentioned in Expected result.

    This gets a little slow compared to my original, but if you like it to.
    Please Login or Register  to view this content.

  22. #22
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @jindon this is very impressive for this great work .
    thanks so much

  23. #23
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    my apologies experts! it's possible summing duplicate items in column C in file RESULT based on your codes in post#16 or 17 or 21,please ?
    especially post#21 I like it .
    thanks again

  24. #24
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    Replace "test" & "mysort" sub procedure with below and other 2 functions must stay intact.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  25. #25
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    @jindon I appreciate your fast answering and thanks for your updating.
    just I have note . the code becomes slow. it gives running speed about 0.510 .is it normal or becuase of my PC?

  26. #26
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    I don't know how many workbooks you are dealing with and formatting, special sort etc.
    If you are saying it is slow, ask someone esle.

  27. #27
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: copy items into column across files and copy to bottom with ignore duplicate items

    I don't know how many workbooks you are dealing with and formatting, special sort etc.
    the same attached files as in OP.
    If you are saying it is slow, ask someone esle.
    no ! just I consult you may be you have idea about this case .
    Last edited by Hasson; 02-09-2022 at 09:27 AM.

+ 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] Macro to Copy Unique items i>e non duplicated items
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2022, 02:04 PM
  2. If duplicate items in same column
    By dkbutler13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-09-2020, 03:17 PM
  3. [SOLVED] Macro to copy specific items in a column
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2019, 02:14 PM
  4. [SOLVED] Copy items where Col D has Fill colured items
    By flupsie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-03-2018, 03:39 AM
  5. Copy selected colour items from one column to another by vba
    By anindya.zen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-25-2014, 01:37 AM
  6. Replies: 5
    Last Post: 12-20-2013, 10:36 PM
  7. Identify Items, Sort those Items, Copy the Items
    By a1981stingray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2010, 10:50 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