How to convert the code from vba macro excel to

Posted on 2014-08-24
Last Modified: 2014-08-30

Cold you please tell how to change the code from vba macro to

Public Function CompareArrays(Array1 As Variant, Array2 As Variant, _
    ResultArray As Variant, Optional CompareMode As VbCompareMethod = vbTextCompare) As Boolean

End Function

iam not able to convert the code. iam getting error like

An error occured converting your code, probably due to a syntax error:
-- line 1 col 8: invalid NonModuleDeclaration
Question by:mannevenu26
    LVL 48

    Expert Comment

    by:Gustav Brock
    Use Linq and it could be like:

    bool isEqual = array1.SequenceEqual(array2);

    LVL 48

    Expert Comment

    by:Gustav Brock
    Great! And you didn't even bother testing as that creates the error reported by the questioneer because this is VBA, not VB.NET.


    Author Comment

    @Gustav Brock,

    What you commented above it is not related my question.
    When iam converting the code i got error that was mention above.please suggest if you have any idea.Please let me know.

    Thanks you.

    Hi friends,
    this function should be convert from vab code to suggest if any body have idea.Please let me know.
    Public Function CompareArrays
                           (Array1 As Variant,
                            Array2 As Variant,
                            ResultArray As Variant,
                            Optional CompareMode As VbCompareMethod = vbTextCompare
                            ) As Boolean
    End Function

    Thank you inadvance. :)
    LVL 48

    Accepted Solution

    My first comment is a method to compare two arrays which is what you ask for.

    The second comment is related to a useless post now deleted.


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now