+ Reply to Thread
Results 1 to 4 of 4

Using Array.sort()

  1. #1
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Using Array.sort()

    Hi all! Please help!

    I red that it's possible to sort arrays in VBA using Array.sort(my array). This requires mscorlib.dll and system namespace.

    Please, what is the complete right code to get things going?

    We are talking about VBA. I prefer to set reference to this dll and then work further. (i guess it's called early binding..)

    Please help!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Using Array.sort()

    you can sort an array with this code
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Using Array.sort()

    I do not think you may access Array.Sort. However you may use ArrayList:
    Please Login or Register  to view this content.
    I do not think this will be so fast as in .Net language or as natural VBA algorithm.
    Last edited by Izandol; 03-18-2014 at 10:03 AM.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Using Array.sort()

    Thanks a lot for answering. Izandol, works like charme!! I need to sort every time 2-5 items. Your code saves coding and very elegant. Thank you!

+ 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: 02-04-2013, 02:28 PM
  2. sort an array by the dates in a different array
    By dvb_24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2012, 04:04 PM
  3. Sort an Array
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-17-2011, 06:33 AM
  4. Sort an array:buble sort,
    By Gary''s Student in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2006, 10:50 AM
  5. sort 2D array
    By Greg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2006, 05:35 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