Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display part of list dependant on Validation list selection | Excel Worksheet Functions | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Return a list dependent upon the selection of a preceeding list | Excel Worksheet Functions | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions |