View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default using a list box to fill text boxes

I'm not quite sure how you've got your data setup but this should get you the
general idea.
Private Sub ListBox1_Click
Dim SelectCell As Range
Const oSet As Long = 0 'Offset that determines how what row to start on
Set SelectCell = Cells(ListBox1.ListIndex + oSet, myColumn)
TextBox1.Text = SelectCell
TextBox2.Text = SelectCell.Offset(,1) 'Cell to the right of SelectCell
TextBox3.Text = SelectCell.Offset(,-1) 'Cell to the left of SelectCell
End Sub

Post back if you need more help
--
Charles Chickering

"A good example is twice the value of good advice."


"Jim T." wrote:

Hi,

I have a form with 2 combo boxes and 1 list box that I would like to use to
automatically fill in numerous text boxes. The first combo box is the sheet
(and stored in variable myUnit for other uses) and the second is the column
(stored in myColumn also) and these generate the list box.

When someone clicks on an item in the list box I need to get more
information from that row and show them in the text boxes on the other side.
I am new at this and nothing seems to be working and appreciate your help.