Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Using a listbox effectivly

Hello,

its me again.

good news, all my input stuff works, my find stuff works,
but now...

can anyone please help, i find records for my list box and
i wish to double click on an entry and open the
appropriate information from columns 2,3,4 and 6.

Thank you,

Robert Couchman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using a listbox effectivly

Hello Robert,

You can use DblClick event on the Listbox and you can get which valu
was doubleclicked with the code below.


Code
-------------------

ListBox1.List(ListBox1.ListIndex)

-------------------


Using this value, please try to find the value in the worksheet.
If you can find the range, you can get the ROW with rows property.
Next you can get appropriate information.


Code
-------------------

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim Seq
Dim rngFound As Range
Seq = ListBox1.List(ListBox1.ListIndex)
Set rngFound = Columns(2).Find(Seq)
If Not rngFound Is Nothing Then
MsgBox Cells(rngFound.Row, 2).Value
MsgBox Cells(rngFound.Row, 3).Value
MsgBox Cells(rngFound.Row, 4).Value
MsgBox Cells(rngFound.Row, 6).Value
End If
End Sub

-------------------


--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Using a listbox effectivly

Thank you for your code, it works very well if there is
only one piece of data specified.

only problem is...

i have my data laid out as follows

listbox1
------------------------------
foundresult + " " + foundresult.offset(0, 2)

so when i look for the data in column 2 it would not find
it due to the column 4 data being added to the list
display.

can anyone help?

either by explaining how to place the found result data
into seperate columns in the list then displaying the
record where the two columns results match on the same row.

or by explaining how to use the columns4 + " " + columns5
as .find result!!

Thank you,

Robert Couchman
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox 2 takes the value of Listbox 1 Illya Teideman Excel Discussion (Misc queries) 3 April 10th 07 03:20 PM
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"