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: 48
Default Use VBA to Populate Listbox from Open Spreadsheet

here's another way. (this assumes your 3 column all next to each
other.) this should get you started, may have to tweak the line that
fills the array a little:

Private Sub UserForm_Click()
Dim rowCount As Integer
Dim myArray() As Variant
Dim i As Integer

'get row count and fill array
rowCount = Cells(Rows.Count, "A").End(xlUp).Row
myArray = Range("A1:C" & rowCount).Value

'fill listBox1
Me.ListBox1.ColumnCount = 3
myArray = WorksheetFunction.Transpose(myArray)
Me.ListBox1.Column = myArray

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
populate listbox? Alen32 Excel Programming 2 June 4th 05 01:18 PM
How to populate a multi-column activeX listbox on a spreadsheet with an ADO recordset quartz Excel Programming 1 May 3rd 04 10:13 PM
populate listbox JSnader Excel Programming 2 December 6th 03 02:43 PM
Populate listBox Hamster Excel Programming 1 September 17th 03 01:14 PM
ListBox Populate Rod Taylor Excel Programming 3 July 22nd 03 12:11 AM


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