Im trying to pick an item from a listbox and have a command button that, when clicked will open a Worksheet!
I understand how to pick an item when the listbox has been populated using the 'AddItem' method, however the listbox is dynamically populated, so the selection will change!
So I would like some help on the correct syntax, (..and if possible an explanation to the code used, as I dont just want to 'copy & Paste'.. it would good to understand [Blocked Image: http://www.mrexcel.com/forum/images/smilies/icon_smile.gif] )
Here's the code for populating the listbox
[/SIZE] Private Sub UserForm_Initialize()Dim rngName As Range Dim ws As Worksheet Dim i As Integer Set ws = Worksheets("Events") For i = 1 To ws.Cells(ws.Rows.Count, 1).End(xlUp).Row Step 1 If ws.Cells(i, 1).Value <> vbNullString Then Me.lbCurrentEvents.AddItem ws.Cells(i, 1).Value Next i lbCurrentEvents.RowSource = "Events!A2:E" & Range("E" & Rows.Count).End(xlUp).RowlbCurrentEvents.ListIndex = lbCurrentEvents.ListIndexEnd Sub[size=14]
Thank you very much!