[Solved] Sort the array in my VBA code

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
gutee
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am

[Solved] Sort the array in my VBA code

Post by gutee »

I have one array, the element is string.
how can I sort the array easily, any function available ?
my_arr(0) = "ccc"
my_arr(1) = "bbb"
my_arr(2) = "aaa"

I need get a sorted array :
my_new_arr(0) = "aaa"
my_new_arr(1) = "bbb"
my_new_arr(2) = "ccc"
Last edited by robleyd on Tue Jan 22, 2019 4:32 am, edited 1 time in total.
Reason: Tagged [Solved]
OpenOffice.org.3.3.0
JeJe
Volunteer
Posts: 2781
Joined: Wed Mar 09, 2016 2:40 pm

Re: Sort the array in my VBA code

Post by JeJe »

Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Lupp
Volunteer
Posts: 3552
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Sort the array in my VBA code

Post by Lupp »

(Why VBA? This is not an MS forum.)

What expectations are there concerning the efficiency? How long (maximum) will the array be that needs sorting?
Will next time probably be accompanying data needing to be included with the sorting?
Is the surrounding application Calc or something else?
How shall 'Empty' data (strings) be treated?
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
gutee
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am

Re: Sort the array in my VBA code

Post by gutee »

Oh, sorry, i'm a beginner. this should be OOo Basic code, right?
Thanks.
OpenOffice.org.3.3.0
gutee
Posts: 19
Joined: Wed Jan 09, 2019 9:12 am

Re: Sort the array in my VBA code

Post by gutee »

Thanks, this works pretty good!
OpenOffice.org.3.3.0
Post Reply