View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick C. Simonds Patrick C. Simonds is offline
external usenet poster
 
Posts: 343
Default Adding items from Listbox to empty textbox

Try this:

Private Sub ListBox1_AfterUpdate()
If TextBox1.Value = "" Then
TextBox1.Value = ListBox1.Value
GoTo Finished
End If

If TextBox2.Value = "" Then
TextBox2.Value = ListBox1.Value
GoTo Finished
End If

If TextBox3.Value = "" Then
TextBox3.Value = ListBox1.Value
GoTo Finished
End If

' continue for the rest of the TextBoxes


Finished:
End Sub
"Corey ...." wrote in message
...
I have a form with 24 textboxes on it.
The form has a populated listbox with data from a sheet.
I want to be able to have the user clcik on any item in the
listbox(Listbox1) and the selected value to be placed intoa Textbox.
But how do i get the value to be placed into the next available (empty)
Textbox from 1-24 ?


Corey....