Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
Not an area I have explored before so any help appreciated. I have a range of data in three columns of a worksheet (the data), I have a userform with a text box control into which the user enters a value (string). Another combo box control on the same userform is currently empty. I wish to use the string entered by the user to search column 1 of the data, if it is found (and it may find it more than once) the combo box is filled with the values in the associated second column of the data. If not a message is displayed. The user then scans the combobox contents and select the required matching record. After which a third control on the userfrom shows the value in the associated third column of the data. Cheers Nigel ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Combobox1_Click()
set rng = Range(cells(1,1),cells(rows.count,1).end(xlup)) combobox2.clear for each cell in rng if cell.value = combobox1.Value then combobox2.AddItem cell.offset(0,1).Value end if Next End If Private Sub Combobox2_Click() set rng = Range(cells(1,1),cells(rows.count,1).end(xlup)) combobox3.clear for each cell in rng if cell.value = combobox1.Value then if cell.offset(0,1).value = combobox2.Value then combobox3.AddItem cell.offset(0,2).Value End if end if Next End If -- Regards, Tom Ogilvy "Nigel" wrote in message ... Hi All Not an area I have explored before so any help appreciated. I have a range of data in three columns of a worksheet (the data), I have a userform with a text box control into which the user enters a value (string). Another combo box control on the same userform is currently empty. I wish to use the string entered by the user to search column 1 of the data, if it is found (and it may find it more than once) the combo box is filled with the values in the associated second column of the data. If not a message is displayed. The user then scans the combobox contents and select the required matching record. After which a third control on the userfrom shows the value in the associated third column of the data. Cheers Nigel ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As usual Tom, simple and elegant. I now have a great template to use.
Cheers Nigel "Tom Ogilvy" wrote in message ... Private Sub Combobox1_Click() set rng = Range(cells(1,1),cells(rows.count,1).end(xlup)) combobox2.clear for each cell in rng if cell.value = combobox1.Value then combobox2.AddItem cell.offset(0,1).Value end if Next End If Private Sub Combobox2_Click() set rng = Range(cells(1,1),cells(rows.count,1).end(xlup)) combobox3.clear for each cell in rng if cell.value = combobox1.Value then if cell.offset(0,1).value = combobox2.Value then combobox3.AddItem cell.offset(0,2).Value End if end if Next End If -- Regards, Tom Ogilvy "Nigel" wrote in message ... Hi All Not an area I have explored before so any help appreciated. I have a range of data in three columns of a worksheet (the data), I have a userform with a text box control into which the user enters a value (string). Another combo box control on the same userform is currently empty. I wish to use the string entered by the user to search column 1 of the data, if it is found (and it may find it more than once) the combo box is filled with the values in the associated second column of the data. If not a message is displayed. The user then scans the combobox contents and select the required matching record. After which a third control on the userfrom shows the value in the associated third column of the data. Cheers Nigel ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation list search | Excel Discussion (Misc queries) | |||
Search for a specific entry in a long data validation list | Excel Discussion (Misc queries) | |||
How to search for the last higher value from a list? | Excel Discussion (Misc queries) | |||
Value Search From a List in a Column | Excel Discussion (Misc queries) | |||
Search in a list. | Excel Discussion (Misc queries) |