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: 14
Default Loading array into list box

I'm trying to load an array into a list box. When I execute the following
macro, it tells me that I have a subscript out of range for the AddItem code.

Sub PopulateListBox()
Dim MyArray As Variant
Dim Ctr As Integer
MyArray = Sheet1Range("A1:A4").Value
For Ctr = LBound(MyArray) To UBound(MyArray)
UserForm1.ListBox1.AddItem MyArray(Ctr)
Next
UserForm1.Show
End Sub
 
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
Array Formulas - Unique List from List with Duplicates Johnny Meredith Excel Discussion (Misc queries) 7 October 27th 06 09:26 PM
Count rows in text file by loading into array L Mehl Excel Programming 5 September 11th 04 07:15 AM
Loading Excel Array from VB Array Faster ExcelMonkey[_3_] Excel Programming 3 January 22nd 04 02:49 AM
Loading Excel Arrange into VBA array [email protected] Excel Programming 5 December 9th 03 01:48 AM
Loading 3 Dimensional Array Alan Beban[_3_] Excel Programming 0 August 31st 03 03:00 AM


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