LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 235
Default Reverse Values in an Array

Thanks Helmut, OssieMac, and Rick for your time and help - all examples
worked perfectly.

--
John






"Rick Rothstein (MVP - VB)" wrote:

I have a one-dimensional array containing values that load a listbox. I
would like to reverse the order of the values as they appear in the
listbox.
The array is called UniqueValues and I'm loading the listbox via the
following:

For Each Item In UniqueValues
frmTrace.ListBox1.AddItem Item
Next Item

Is there a way to reverse the values without dropping the values into a
worksheet, resorting, and reloading?


Use the same code you have, but add the optional argument to the AddItem
method...

For Each Item In UniqueValues
frmTrace.ListBox1.AddItem Item, 0
Next Item

Rick




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse a function to return the array? bc4240 Excel Worksheet Functions 4 July 31st 09 05:25 AM
search an array in reverse (bottom to top) order Trainer_00 Excel Discussion (Misc queries) 5 December 20th 07 10:35 PM
How to reverse data in an Array Kevin O'Neill[_2_] Excel Programming 3 January 4th 06 06:39 PM
Reverse numerical values [email protected] Excel Worksheet Functions 4 November 10th 05 04:47 PM
how to reverse a range/array? peter dmz Excel Worksheet Functions 5 August 11th 05 09:11 PM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"