Thread: ListBox problem
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Patrick Simonds Patrick Simonds is offline
external usenet poster
 
Posts: 258
Default ListBox problem

Thanks a lot works great.


"Norman Jones" wrote in message
...
Hi Patrick,

Try:

ActiveCell.Value = ListBox1.List(ListBox1.ListIndex, 0)
ActiveCell(2, 1).Value = ListBox1.List(ListBox1.ListIndex, 6)

---
Regards,
Norman



"Patrick Simonds" wrote in message
...
Thank You your code worked to a point. I need this to work from the
active cell not from column A. So if I am in cell B5 I want the results
in cells B5 and B6 or if in cell R20 the results would need to go into
cells R20 and R21 ect.



"Nigel" wrote in message
...
I used OFFSET as part of the range definition worked for me, I notice
that
your column references are 0 and 7 suggesting there might be 8 columns?
When you stated there are 7, so you might want to check that out as
well.

Private Sub CommandButton3_Click()

Dim rng

Set rng = Cells(ActiveCell.Row, 1)

rng.Offset(0, 0).Value = ListBox1.List(ListBox1.ListIndex, 0)
rng.Offset(0, 1).Value = ListBox1.List(ListBox1.ListIndex, 7)

Unload Me

End Sub

--
Cheers
Nigel