Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Populating a ListBox with an Array

I have 2 ListBoxes on my UserForm, the ListBox1 Has a list in it
(RowSourced) and i want the Userform to Put information (a list) in ListBox2
According to what is selected in ListBox1.

I have it far enough that i can get a start cell and stop cell (in the same
column) of the information I want. This is the information i want in ListBox1

I hope i have made this clear enough

Thanks in advance
ironhydroxide
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Populating a ListBox with an Array

not really. but maybe this example can get you started.

Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim ws As Worksheet
Dim i As Long
Set ws = Worksheets("Sheet1")
For i = 1 To 8
If Me.ListBox1.Value = "A" Then

Me.ListBox2.AddItem Worksheets("Sheet1").Range("A" & i).Value
Else
Me.ListBox2.AddItem Worksheets("Sheet1").Range("B" & i).Value
End If

Next
End Sub

--

Gary Keramidas
Excel 2003


"ironhydroxide" wrote in message
...
I have 2 ListBoxes on my UserForm, the ListBox1 Has a list in it
(RowSourced) and i want the Userform to Put information (a list) in
ListBox2
According to what is selected in ListBox1.

I have it far enough that i can get a start cell and stop cell (in the
same
column) of the information I want. This is the information i want in
ListBox1

I hope i have made this clear enough

Thanks in advance
ironhydroxide


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
Populating listbox Mick[_2_] Excel Discussion (Misc queries) 1 May 14th 08 10:48 PM
populating a listbox from an array Graham Whitehead Excel Programming 2 August 2nd 06 01:11 PM
Populating listbox Andy Brown Excel Programming 3 August 16th 04 05:40 PM
Populating a ListBox ToddG Excel Programming 1 June 24th 04 03:18 AM
populating multicolumn listbox with an array instead of... notsureofthatinfo Excel Programming 0 November 5th 03 10:18 PM


All times are GMT +1. The time now is 09:01 AM.

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

About Us

"It's about Microsoft Excel"