+ Reply to Thread
Results 1 to 18 of 18

Compare data in columns and return separately Part II

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Compare data in columns and return separately Part II

    hi

    i try adapt code make by expert jindon, but I did not get success.
    Attached Files Attached Files
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Compare data in columns and return separately Part II

    Well jindon writes pretty advanced codes...

    Guess only he or some other VBA gurus will be able to guide you through..
    Cheers!
    Deep Dave

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    Hi NeedForExcel , download my file to uderstand.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    marreco,

    Where is jindon's code? It is not in the book you uploaded, and maybe with that we can help modify.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    Hi I recommend downloading the file
    Please Login or Register  to view this content.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    I have downloaded the file... it didn't have that code in it. Thanks.

  7. #7
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    in my i show before and after result, if you can help, I am grateful.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    Ok marreco,

    I understand your example, column F has unique list of ndoc. But columns H to K, which date goes there? The PREVISAO_DATA date? or the ATUAL_DATA date?

  9. #9
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    Two columns F and G (ndoc | PREVISAO_DATA) uniq.
    But columns H to K, which date goes there?
    ATUAL_DATA date.

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    My coding is not as good as Jindon's but try this and let me know...

    Please Login or Register  to view this content.
    Oh you do have to go to VBA editor, click tools, references, and put check in box next to "Microsoft Scripting Runtime"
    Last edited by Arkadi; 04-01-2015 at 09:05 AM.

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

    Re: Compare data in columns and return separately Part II

    Is this how you wanted?
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    Why display RunTime error
    user-defined type not defined
    ?

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

    Re: Compare data in columns and return separately Part II

    It must be Arkadi's code. Arkadi use early binding which requires to reference scripting in tools-reference.

  14. #14
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    marreco,

    As said in my previous post, you nee to go to VBA editor, click tools, references, and put check in box next to "Microsoft Scripting Runtime"

  15. #15
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    Quote Originally Posted by AB33 View Post
    It must be Arkadi's code. Arkadi use early binding which requires to reference scripting in tools-reference.
    I wondered AB33, I am very partial to early binding, and aside from occasional confusion due to reference not being set, I find it more convenient. BUT, is there a significant advantage to either method?

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

    Re: Compare data in columns and return separately Part II

    Yes,
    Early binding gives you auto pop-up or intellisense. If you do not know the methods and properties of the object, this is could be very handy. Lost of people also claim that Early is faster than late.
    The main disadvantage is what you have got in to. All users of the code have to enable the reference(connection). There is an issue of incompatibility too.
    What most developers do this way: write the code first using early to get all the help you can get, then after you run it and works and convert it in to late.
    I use early lots of time when I try to code using ADO as I do not know most of the properties and methods.
    Last edited by AB33; 04-01-2015 at 10:03 AM.

  17. #17
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Compare data in columns and return separately Part II

    hi need say thank you for all great experts (AB33, Arkadi and jindon), thank very much !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  18. #18
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Compare data in columns and return separately Part II

    marreco,
    De nada! Glad we could help

    AB,

    Thanks. I think in future I will convert to late binding to avoid confusion, and yes the intellisense can help lots. Like you, I use it very often for ADO.

+ 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. Sort different columns separately, and create combo box to filter the data.
    By TallOne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2014, 07:50 AM
  2. [SOLVED] using an if statement to compare 2 columns of data and return text information
    By VanessaF in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-18-2013, 05:47 AM
  3. [SOLVED] Compare data in columns of two worksheets and return value if match.
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2013, 10:38 AM
  4. [SOLVED] Compare data in columns and return separately
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2013, 07:36 PM
  5. Replies: 4
    Last Post: 02-12-2013, 12:15 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