Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default list box selection?

Hi
In your UserForm_Initialise() sub insert

Me.ListBox1.Rowsource = Sheet1!A1:A5

to populate Listbox1 with data in range A1 to A5 on sheet1.

regards
Paul

Hazel wrote:

Hi All

I'm using a userform populated from the Row Source on the first sheet - I
have used a snippet of code off this forum to change the sheet in the
workbook thats OK how do I then populate the list box from the new sheet. Its
only a simple form so have included all the code being used below.

Option Explicit


Private Sub UserForm_Initialise()



Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3) =
Me.Tb1.Value



End Sub
Private Sub Add1_Click()
If Me.Lb1.ListIndex -1 Then
Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3) =
Me.Tb1.Value
End If
End Sub

Private Sub Lb1_Click()
Tb1.Value = ""
End Sub

Private Sub UserForm_Activate()
Com1.Value = "Select Members Sheet"
Com1.AddItem "JBloggs"
Com1.AddItem "ASmith"

End Sub

Private Sub Com1_Click()
If Com1.ListIndex < -1 Then
Worksheets(Com1.Value).Select
End If
End Sub


--
Many thanks

hazel


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
Display part of list dependant on Validation list selection Jules73 Excel Worksheet Functions 0 August 12th 09 02:21 PM
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Return a list dependent upon the selection of a preceeding list Aja K Excel Worksheet Functions 4 April 11th 07 07:48 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


All times are GMT +1. The time now is 01:52 PM.

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"