+ Reply to Thread
Results 1 to 33 of 33

Auto complete from 1 sheet to another (can not repeat cells info)

  1. #1
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Exclamation Auto complete from 1 sheet to another (can not repeat cells info)

    Hi Guys,
    Nice to meet you all
    I am a beginner with VBA and I am doing this spreedshet for my company.

    I need to do an auto-complete from the "SAP report" sheet to the "orders" sheet by VBA.
    It needs to bring only the orders that aren't in the "orders" sheet already. Please find the SS attached below.
    Untitled.jpg

    I found a macro in the internet but it copy and paste all cells of the column.
    What I am looking for is to copy only the cells which are not in the sheet already.
    In both sheets, the information (orders) are in the column A.

    Looking forward to hear from you guys
    Thanks!
    Last edited by ricdamiani; 08-19-2013 at 10:39 PM.

  2. #2
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Please guys... Any idea?!

  3. #3
    Registered User
    Join Date
    07-09-2013
    Location
    Poland
    MS-Off Ver
    excel 2007
    Posts
    85

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Maybe that would work for You.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Thanks mate.
    I will try tmrw at work and get back to you.

  5. #5
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    we cant cross check or code on JPG file..

    please attache sample EXCEL file..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  6. #6
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hey guys.
    First thanks to mumsys and Debraj Roy reply.
    Unfortunately it didn't work. The error message was: "compile error: syntax error", and it was in the line Cell.EntireRow Copy orders.Range("A" & Rows.Count).End(xlUp).Offset(1)

    Please find the Excel file below:
    New production B.xlsx

    Looks like we almost there, just a small error, right?


    Well, looking forward to hear from you again

    Btw, I am at work now so I can try and reply straight away

    Thanks!

  7. #7
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hi guys!
    Anybody else can help me with that?!
    Cheers

  8. #8
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    I hate to be that guy that always put the topic up, but I really need some help on that
    I will give a box of cookies to the person who help me :D

  9. #9
    Registered User
    Join Date
    07-09-2013
    Location
    Poland
    MS-Off Ver
    excel 2007
    Posts
    85

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Please check if that work for You
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Quote Originally Posted by mumsys View Post
    Please check if that work for You
    Please Login or Register  to view this content.
    Wowww... almost there... the only problem is sometimes there is more than one item in a order, so the order number will repeat (some orders have up to 10 items)... For example order 6157 has 2 items:
    ORDERS ITEM
    6157 Item 21
    6157 Item 49

    There is a way to get the repeated order numbers as well???

    Almost there buddy...
    Thanks a lot!

  11. #11
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    And can I paste values only???????
    Last edited by ricdamiani; 08-01-2013 at 06:05 AM.

  12. #12
    Registered User
    Join Date
    07-09-2013
    Location
    Poland
    MS-Off Ver
    excel 2007
    Posts
    85

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Quote Originally Posted by mumsys View Post
    Please Login or Register  to view this content.
    Actually now is pasting ALL the column... in the first macro was pasting only the orders that weren't in there (but if the order had more than 1 item, it just pasted the first one)...
    Now is pasting when the order have more than 1 item, but is repeating the orders that were already there...
    Last edited by ricdamiani; 08-01-2013 at 06:20 AM.

  14. #14
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hi mumsys and other users,

    So, the last macro fixed one point and created another problem.
    Fixed that sometimes you have repeated orders with different items (it will have 2 cells in the same column with same data, but in another column it will have a different data).
    The problem created is that the macro is copying including the cells that are already there. So every time I will run this macro, it will repeat everything I already have.

    There is a way to fix it?
    And the last point would be past values only (not formatting). Is that possible?

    Excel file attache below describing all the points:
    New production EXAMPLE.xlsx

    Thanks guys!

  15. #15
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    What are trying to do?
    Are you trying to compare(Match ) the master sheet with order sheet? Which column do you want to use compare both sheets?
    You have SAP O/No. Item Description
    on both sheets

  16. #16
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Quote Originally Posted by AB33 View Post
    What are trying to do?
    Are you trying to compare(Match ) the master sheet with order sheet? Which column do you want to use compare both sheets?
    You have SAP O/No. Item Description
    on both sheets
    Hi AB33,

    -What I am trying to do:
    The "orders" sheet will be used by the production manager. The "SAP report" sheet will be updated everyday with the report from SAP (I will just extract as excel file and copy and paste on this file, in the "SAP report" sheet).
    The production manager will run the macro and update the new orders in the "Orders" sheet.
    Some orders can have more than 1 item, so the order number will be repeated in the sheet (SAP generate 1 item per row).

    The point is, the orders that are already in "Orders" can not be modified, as the production manager will wright the production date and machine on those orders.
    So the macro needs to update only what is not in "Orders" and is on "SAP report", including orders numbers that are repeated because have more than a item.

    -Are you trying to compare(Match ) the master sheet with order sheet? Which column do you want to use compare both sheets?
    Yes, I am trying to compare, and fill automatic. In both sheets they are in column A. From "SAP report" column A to "Orders" column A.
    And it is just past value.


    Sorry if I was too long.
    I appreciate your reply.
    Thank you!

  17. #17
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Okay!
    All rows In sheet orders are in sheet master, but not all rows on sheet master are in sheet orders. That is, there are some rows missing from sheet order. All nos from 5922 in master sheet are missing in order sheet.
    Do not stressed! We will find you a solution, just need some time to understand your data.
    Last edited by AB33; 08-01-2013 at 07:42 AM.

  18. #18
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Quote Originally Posted by AB33 View Post
    Okay!
    All rows In sheet orders are in sheet master, but not all rows on sheet master are in sheet orders. That is, there are some rows missing from sheet order. All nos from 5922 in master sheet are missing in order sheet.
    Do not stressed! We will find you a solution, just need some time to understand your data.
    Cheers dude.
    Looking forward to hear from you

  19. #19
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Ric,
    Please do not reply with quote, just a reply will do.
    So, do you want to fill up sheet orders missing rows from master sheet? Do you want to copy column A only?
    If it is the case, I will get back to you in 30 minutes, but need confirmation

  20. #20
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    The code brings all missing, including the duplicates. Try it and will amend if necessary.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Not a problem
    Yes, I want to fill up cells from "SAP report" sheet column A, to "Orders" sheet column A.
    Just wanna remember you that sometimes it has repeated cells that must be copied as well to "Orders", but the cells that are already in "Orders" cannot be edit or duplicated.

    Thank you AB33!

  22. #22
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Try post no 20.

  23. #23
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Yes, it is working AB33.
    Tomorrow (here is 10:30pm) I will try in the official sheet at work and get back to you ASAP.
    I appreciate your effort and kindliness (and also your knowledge, I had a look in the macro and I was like ).
    Thank you.

  24. #24
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    When you walk up in the morning, you might find out that the Aussie have already lost the "Ashes"

  25. #25
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hi AB33,

    Your macro was copying all the columns. The solution I found was delete .CurrentRegion.Value and change the range to a5:a99999.
    So here is my final code:

    Please Login or Register  to view this content.
    And here was YOUR code:
    Please Login or Register  to view this content.
    Do you think it is ok now?

    Thanks dude
    Last edited by ricdamiani; 08-01-2013 at 11:42 PM.

  26. #26
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Sorry,
    I did not realise the code was looping through the columns.
    Use this code instead.

    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    I reckon it is working, I did some quick tests and looks good... Thanks mate!
    I will put this topic as "solved"... if I find some error I will let you know.
    Have a good weekend

  28. #28
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hi AB33,

    The macro stop if there is a blank cell. Could you please update to keep looping if it finds a blank cell?

    You can find the sheet below explaining exactly what I mean:
    Production example 2.xlsm

    Thanks dude

  29. #29
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    The macro stop if there is a blank cell?
    Not sure what do you mean? Do you mean you have a blank row or column so that the current region would not work?
    The code will not loop until the last cell if there is a gap(Blank row or column).
    On the attached there is none. You have 141 rows on both sheets, so need to clarify.

  30. #30
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Hi AB33,
    Thanks for the reply

    What happen is the SAP report bring always 1 row with data and then 1 blank row, 1 row with data and then 1 blank row, and so forth.
    I did the a new simulation so you can understand it better:
    Production example 2b.xlsm

    There is a way to fix the macro?!

    If you didn't understand please let me know.
    Thank you!

  31. #31
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Okay, use this line

    Please Login or Register  to view this content.
    Instead of

    Please Login or Register  to view this content.

  32. #32
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Works perfectly
    Thanks AB33.

  33. #33
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Auto complete from 1 sheet to another (can not repeat cells info)

    Forget about it.
    Cheers
    Last edited by ricdamiani; 08-19-2013 at 10:38 PM.

+ 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. Replies: 0
    Last Post: 08-03-2012, 11:34 AM
  2. [SOLVED] Auto-complete names from another sheet
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2012, 09:14 AM
  3. Auto Complete in a table from another sheet
    By ganderson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2011, 01:40 PM
  4. How do I auto complete cells?
    By sonars in forum Excel General
    Replies: 3
    Last Post: 04-24-2009, 06:01 AM
  5. Replies: 3
    Last Post: 01-02-2007, 09:03 PM

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