Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ComboBox filtered on partial match?

I want to fill a Combobox with items from a spreadsheet column (9500 cells)
where there is an "in-string" match to the data I enter in the Combo-box.
For example, if I were to type the word "disk" into the Combobox, the
Combobox would display the following items only from my 9500 items:

hard disk
harddisk
disk-drive
diskette

I must match one of the items, and ideally also I would like to retrieve the
row number of my final choice for further use (bound column).

I have a few ideas like filling an array using the Change event, but I'm
wondering if there's an easier way by maybe using a RecordSet?

Hope someone can help! Thanks.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ComboBox filtered on partial match?

You want to type "disk" in the combobox, then have the combobox List only
contain items that contain the word disk, then you want to select one of
these and have that be the value of the combobox.

If you receive the row number is it the row number against the original data
(1 to 9500) or against the culled data (a list with each item containing the
word disk)?

You could use an autofilter to filter your data or look at the filter
command (in xl2000 or later).


--
Regards,
Tom Ogilvy



Ian Chappel wrote in message
...
I want to fill a Combobox with items from a spreadsheet column (9500

cells)
where there is an "in-string" match to the data I enter in the Combo-box.
For example, if I were to type the word "disk" into the Combobox, the
Combobox would display the following items only from my 9500 items:

hard disk
harddisk
disk-drive
diskette

I must match one of the items, and ideally also I would like to retrieve

the
row number of my final choice for further use (bound column).

I have a few ideas like filling an array using the Change event, but I'm
wondering if there's an easier way by maybe using a RecordSet?

Hope someone can help! Thanks.








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ComboBox filtered on partial match?

Thanks Tom

The row number returned would be against the original data, i.e. 1 to 9500.

I realise I could do this quite simply on the actual sheet using Autofilter
etc., but I do need the filtered data returned as my choices in the
Combobox. The Combobox is in another workbook, although they'll both be open
at the same time. I guess the problem would not be much different if the
Combobox was in a user form.

"Tom Ogilvy" wrote in message
...
You want to type "disk" in the combobox, then have the combobox List only
contain items that contain the word disk, then you want to select one of
these and have that be the value of the combobox.

If you receive the row number is it the row number against the original

data
(1 to 9500) or against the culled data (a list with each item containing

the
word disk)?

You could use an autofilter to filter your data or look at the filter
command (in xl2000 or later).


--
Regards,
Tom Ogilvy



Ian Chappel wrote in message
...
I want to fill a Combobox with items from a spreadsheet column (9500

cells)
where there is an "in-string" match to the data I enter in the

Combo-box.
For example, if I were to type the word "disk" into the Combobox, the
Combobox would display the following items only from my 9500 items:

hard disk
harddisk
disk-drive
diskette

I must match one of the items, and ideally also I would like to retrieve

the
row number of my final choice for further use (bound column).

I have a few ideas like filling an array using the Change event, but I'm
wondering if there's an easier way by maybe using a RecordSet?

Hope someone can help! Thanks.










  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ComboBox filtered on partial match?

assuming xl2000 or later

set rng =Workbooks("Data.xls").Worksheets("Sheet1").Range( "A1:A9500")
varr1 = rng.Value
combobox1.list = Filter(varr1,combobox1.Value,True,vbTextCompare)




set rng =Workbooks("Data.xls").Worksheets("Sheet1").Range( "A1:A9500")
res = Application.Match(combobox1.Value, rng,0)
if not iserror(res) then
set rng1 = rng(res)
msgbox rng1.row
Else
msgbox "No Match????"
End if

--
Regards,
Tom Ogilvy


Ian Chappel wrote in message
...
Thanks Tom

The row number returned would be against the original data, i.e. 1 to

9500.

I realise I could do this quite simply on the actual sheet using

Autofilter
etc., but I do need the filtered data returned as my choices in the
Combobox. The Combobox is in another workbook, although they'll both be

open
at the same time. I guess the problem would not be much different if the
Combobox was in a user form.

"Tom Ogilvy" wrote in message
...
You want to type "disk" in the combobox, then have the combobox List

only
contain items that contain the word disk, then you want to select one of
these and have that be the value of the combobox.

If you receive the row number is it the row number against the original

data
(1 to 9500) or against the culled data (a list with each item containing

the
word disk)?

You could use an autofilter to filter your data or look at the filter
command (in xl2000 or later).


--
Regards,
Tom Ogilvy



Ian Chappel wrote in message
...
I want to fill a Combobox with items from a spreadsheet column (9500

cells)
where there is an "in-string" match to the data I enter in the

Combo-box.
For example, if I were to type the word "disk" into the Combobox, the
Combobox would display the following items only from my 9500 items:

hard disk
harddisk
disk-drive
diskette

I must match one of the items, and ideally also I would like to

retrieve
the
row number of my final choice for further use (bound column).

I have a few ideas like filling an array using the Change event, but

I'm
wondering if there's an easier way by maybe using a RecordSet?

Hope someone can help! Thanks.












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
Vlookup on partial match Robert_L_Ross Excel Worksheet Functions 1 October 27th 09 11:25 PM
Find partial match from column A,B and fill partial match in C? Tacrier Excel Discussion (Misc queries) 4 October 24th 08 11:24 PM
DSUM Partial Match Bob H[_2_] Excel Worksheet Functions 3 July 27th 07 10:48 PM
partial lookup/match myra_deV Excel Worksheet Functions 0 May 9th 06 03:19 PM
Partial String Match Using VLOOKUP cdhmotes Excel Worksheet Functions 4 December 26th 05 10:26 PM


All times are GMT +1. The time now is 04:10 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"