Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jasper
 
Posts: n/a
Default Determine size of listbox

Hello,

i have a listbox containg about 150 items. when i use vba to count the
number of items, both UBound and ListCount tell me there are 128 items.
How come it doesnt say there are 150 items??

Thanks for any help...
Jasper

  #2   Report Post  
Posted to microsoft.public.excel.misc
E.Q.
 
Posts: n/a
Default Determine size of listbox

What is the source data for the listbox?
If it is a range could a simple Excel function such as COUNTA() or ROWS()
work?
or is the listbox populated some other way.
I've never used the VBA you mentioned, sorry to say. But looking them up in
"help" it doesn't look like they determine the cardinality of set of items
populating list box. UBOUND determines a max value within an array diminsion
and ListCount determines count of rows over which you can scroll.
Maybe a more experienced programmer can elucidate for us.

Regards
E.Q. C.

"Jasper" wrote:

Hello,

i have a listbox containg about 150 items. when i use vba to count the
number of items, both UBound and ListCount tell me there are 128 items.
How come it doesnt say there are 150 items??

Thanks for any help...
Jasper


  #3   Report Post  
Posted to microsoft.public.excel.misc
Jasper
 
Posts: n/a
Default Determine size of listbox

I used another macro that put the names of 146 different sheets (in the
same workbook) in the listbox. i put them in a listbox so i can double
click on the name so i jump to the corresponding sheet (i know i can
use the arrows next to the name of the most left sheet to do this, but
i want to use a listbox).

i need to last item in the listbox so i can use a loop to sort them. if
i dont use the last item number (128 in this case) but make enter (for
example) 150 as the end of the loop, then by the time the loop reaches
item 129 i get an error stating there is no item 129 (while obviously
there is...).

i hope that clarifies?

  #4   Report Post  
Posted to microsoft.public.excel.misc
E.Q.
 
Posts: n/a
Default Determine size of listbox

Would it be possible to hack into your original macro and insert an index
that could be used in your sorting macro? (Does it use a "for each"
construction?) Or perhaps your list-populating macro could also perform a
sort?
I apologize for not being able to answer directly, but perhaps you can find
a work-around.

"Jasper" wrote:

I used another macro that put the names of 146 different sheets (in the
same workbook) in the listbox. i put them in a listbox so i can double
click on the name so i jump to the corresponding sheet (i know i can
use the arrows next to the name of the most left sheet to do this, but
i want to use a listbox).

i need to last item in the listbox so i can use a loop to sort them. if
i dont use the last item number (128 in this case) but make enter (for
example) 150 as the end of the loop, then by the time the loop reaches
item 129 i get an error stating there is no item 129 (while obviously
there is...).

i hope that clarifies?


Reply
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
chart size zdenek Charts and Charting in Excel 0 February 9th 06 09:58 AM
My tabs' font size is smaller - how do I restore default size? katykins53 Excel Discussion (Misc queries) 1 January 11th 06 12:07 AM
Print Excel charts in Word 2003 with fixed size Phil Charts and Charting in Excel 1 November 3rd 05 04:24 AM
Font size in conditinal formatting GDC Excel Discussion (Misc queries) 0 October 18th 05 06:38 PM
Large Excel file size caused by a bug ? I really tried everything Anik Excel Discussion (Misc queries) 5 March 16th 05 06:19 PM


All times are GMT +1. The time now is 10:58 PM.

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"