View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default ListBox Question

What do you mean by "has a formula in it (Date)"

What does listbox2 display as selected and what is entered in the cell.

Is listbox2 a multicolumn listbox - it is possible you have an empty column
and it is returning the empty value in that column.

the textcolumn is what is displayed to the user. The boundcolumn is what is
assigned as the value of the listbox.

You can reference other columns using either the list or column properties.

Cells(NextRow,8).Value = listbox1.List(listbox1.listindex,2)
would give you the value of column 3. (column 1 is zero).

--
Regards,
Tom Ogilvy


Randal W. Hozeski wrote in message
news:50SEb.93812$8y1.301650@attbi_s52...
I am using the following code to display results of a userform,
but for some reason the ListBox2 does not populate my sheet.
ListBox1 and TextBox1 come thru fine. The only difference
between the range in ListBox1 and ListBox2, is that ListBox1
has text and ListBox2 has a formula in it (Date)
field. Any idea why/suggestions?

NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 1) = ListBox1.Text
Cells(NextRow, 2) = ListBox2.Text (tried .Value too)
Cells(NextRow, 3) = TextBox1.Text

Also ListBox1 has 4 columns in it and it returns the value that
is in the first column. What if I want the value of Column 1 in
the result page first cell and the value of column 3 in another?

Thanks -Randy-

Thanks -Randy-