#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Update one worksheet tab to automatically update all other tabs? shoechic1 Excel Worksheet Functions 1 May 24th 09 03:55 PM
Data Validation lists update orginal cell with list update [email protected] Excel Worksheet Functions 3 July 11th 08 07:56 AM
i want to update one excel file the other one update automaticaly Basant New Users to Excel 1 December 16th 06 12:50 AM
keep value from last update and don't ask to update links jh3016 Excel Discussion (Misc queries) 3 July 25th 05 01:37 AM
Date update on data update Chris Thompson Excel Programming 3 August 22nd 03 06:40 PM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"