Thread: Update
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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