LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Reload Listbox - type mismatch error

I've created to arrays that hold the sheet names for a worksheet,
mySheetList() which holds the natural sheet order and
mySheetListAlpha() which holds a the sheet names alphabetically
ordered. I want to offer the user a form containing a listbox with the
sheetnames and two buttons on the form that the user select either
natural order or alphabetically ordered. By clicking on the buttons,
the listbox is dynamically updated with either one of the two arrays.
I call a list box via UserForm_Initialize() and populate the list with:


ListBox1.List = mySheetList

This part works well (I can also get the listbox populated
alphabetically with ListBox1.List = mySheetListAlpha). My problem lies
in trying to update the listbox with the second array. On the form is
a command button with the following code

Listbox.Clear
For X = LBound(mySheetListAlpha) To UBound(mySheetListAlpha)
ListBox1.AddItem mySheetListAlpha(X)
Next

The listbox.clear command clears the listbox but the second line of
code causes Type Mismatch error. Can someone tell me how I can
repopulate the listbox with values held in the second array.

Thanks

 
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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
type mismatch error Marcotte A Excel Programming 1 March 31st 05 01:39 AM
Type mismatch error mpjohnston[_2_] Excel Programming 3 August 31st 04 12:33 AM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Type Mismatch error Mike Excel Programming 3 January 17th 04 04:23 PM


All times are GMT +1. The time now is 04:19 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"