Thread: Listbox help.
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Listbox help.

Put the listbox on your userform, and add this line to your UserForm_Initialize event

Me.ListBox1.List = Worksheets("SheetName").Range("A1:A36").Value

(use the actual sheet name and range where your list is stored)

Then, use a CommandButton on your userform, and in its click event, use code like this to get the
value into the bottom of column D:


Private Sub CommandButton1_Click()
Worksheets("DBSheetName").Cells(Rows.Count,4).End( xlUp)(2).Value = Me.ListBox1.Value
End Sub


HTH,
Bernie
MS Excel MVP


"Morlin" wrote in message
...
Alot of folks have been nice to help me with things on here. I
appreciate it. I have a new project.

Listbox. I have a list that I want to be accessed from a userform

the list consists of just a single line of information.

1 Age
2 Education
3 Dishonorable discharge
4 Felony Conviction
5 Felony Commission
all the way to #36.

I'm creating a data entry form that will have name, ssn, dob, DQ
reason (my listbox), date of app

then obviously an enter button to enter the info onto the
spreadsheet. Could somebody tell me how to make the listbox?

Thanks ahead of time.