Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
Hello,
can anyone help, i am looking for a piece of code that can be used as a update text box. i have 3 text boxes and a list box, what i want is so that if a value is typed into one of the boxes it will list the related information in the list box, i.e. if a person types 'Rob' in the middle text box (name box) then the list box will produce a list where all the values in the name column begin with 'Rob', and then using the offset command (unless others are better) it will display all the relevant information. i could then manipulate the code so that if a value is typed into another field that is incorrect or does not appear in that column then the results would disapear, or if the correct data is entered it will narrow the selection more. Thank you for all help, Robert Couchman |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
Listbox1.Clear
With worksheets("Data") set rng = .Range(.Cells(2,5),.Cells(2,5).End(xldown)) End with for each cell in rng if instr(1,cell,Textbox2.Text,vbTextCompare) then listbox1.AddItem cell.Value end if Next -- Regards, Tom Ogilvy "Robert Couchman" wrote in message ... Hello, can anyone help, i am looking for a piece of code that can be used as a update text box. i have 3 text boxes and a list box, what i want is so that if a value is typed into one of the boxes it will list the related information in the list box, i.e. if a person types 'Rob' in the middle text box (name box) then the list box will produce a list where all the values in the name column begin with 'Rob', and then using the offset command (unless others are better) it will display all the relevant information. i could then manipulate the code so that if a value is typed into another field that is incorrect or does not appear in that column then the results would disapear, or if the correct data is entered it will narrow the selection more. Thank you for all help, Robert Couchman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
Thank you Tom,
but under what Private sub should i call this feature? i usualy try _afterupdate() also where would this usualy be best placed? i would think textbox2_afterupdate looking at the procedure! Thank you, Robert Couchman -----Original Message----- Listbox1.Clear With worksheets("Data") set rng = .Range(.Cells(2,5),.Cells(2,5).End(xldown)) End with for each cell in rng if instr(1,cell,Textbox2.Text,vbTextCompare) then listbox1.AddItem cell.Value end if Next -- Regards, Tom Ogilvy |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
That sounds good to me.
-- Regards, Tom Ogilvy "Robert Couchman" wrote in message ... Thank you Tom, but under what Private sub should i call this feature? i usualy try _afterupdate() also where would this usualy be best placed? i would think textbox2_afterupdate looking at the procedure! Thank you, Robert Couchman -----Original Message----- Listbox1.Clear With worksheets("Data") set rng = .Range(.Cells(2,5),.Cells(2,5).End(xldown)) End with for each cell in rng if instr(1,cell,Textbox2.Text,vbTextCompare) then listbox1.AddItem cell.Value end if Next -- Regards, Tom Ogilvy |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
Any idea of how to get more than 1 text box to edit the
data in the list? I.e. you type "Rob" in textbox1 and "Couch" in textbox2 and the list will produce th results "Robert Couchman"? i can get the list to display the full data in more than 1 cell, e.g. i type "rob" and it will list all cells with "rob" in and also the following cells "Robert Couchman" Thank you, Robert Couchman |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update
Assume Robert Couchman is all in one cell:
Listbox1.Clear With worksheets("Data") set rng = .Range(.Cells(2,5),.Cells(2,5).End(xldown)) End with for each cell in rng if instr(1,cell,Textbox1.Text,vbTextCompare) and _ instr(1,cell,Textbox2.Text,vbTextCompare) then listbox1.AddItem cell.Value end if Next -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Listbox1.Clear With worksheets("Data") set rng = .Range(.Cells(2,5),.Cells(2,5).End(xldown)) End with for each cell in rng if instr(1,cell,Textbox2.Text,vbTextCompare) then listbox1.AddItem cell.Value end if Next -- Regards, Tom Ogilvy "Robert Couchman" wrote in message ... Hello, can anyone help, i am looking for a piece of code that can be used as a update text box. i have 3 text boxes and a list box, what i want is so that if a value is typed into one of the boxes it will list the related information in the list box, i.e. if a person types 'Rob' in the middle text box (name box) then the list box will produce a list where all the values in the name column begin with 'Rob', and then using the offset command (unless others are better) it will display all the relevant information. i could then manipulate the code so that if a value is typed into another field that is incorrect or does not appear in that column then the results would disapear, or if the correct data is entered it will narrow the selection more. Thank you for all help, Robert Couchman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update one worksheet tab to automatically update all other tabs? | Excel Worksheet Functions | |||
Data Validation lists update orginal cell with list update | Excel Worksheet Functions | |||
i want to update one excel file the other one update automaticaly | New Users to Excel | |||
keep value from last update and don't ask to update links | Excel Discussion (Misc queries) | |||
Date update on data update | Excel Programming |