LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userforms/Macro Search

And if they are listboxes as you said (rather than textboxes) you would
adjust the code to:


Code:
--------------------

Sub Listbox1_Click()

Dim r as Range
Dim strFind as String
Dim sh as Worksheet
set sh = Worksheets("Data")
strFind = Lcase(ListBox1.Text)

For Each r in Sh.Range("A1:A" & sh.Range("A65535").End(xlUp).Row)
If lcase(r.Value) = strFind Then
ListBox2.AddItem sh.Range("F" & r.Row).Value
ListBox3.AddItem sh.Range("G" & r.Row).Value
End If
Next

End Sub
--------------------


--
Regards,
Tom Ogilvy




 
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
Search Macro Eán[_2_] Excel Worksheet Functions 3 April 21st 10 02:51 PM
Macro for Search Brigette Excel Discussion (Misc queries) 6 December 17th 09 04:44 PM
Search Macro Gary Excel Discussion (Misc queries) 1 March 29th 07 04:53 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 09:58 AM.

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"