Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

lookup value in sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eyesonly1965 - 11 May 2006 21:48 GMT
in my form i have 2 textboxes that i'm trying to link.
for example:
textbox1= code
textbox2= disciption

in a sheet i have a range
in cells a1 to a100 there are codes
in cells b1 to b100 there are the discriptions

now is my question if it is possible to give the code in textbox1 and
textbox2 shows the discription automaticly.

can anybody tell me if it is possible and how it is done?

Signature

eyesonly1965

eyesonly1965 - 12 May 2006 06:22 GMT
is there anyone who can help me with this problem?:eek:

Signature

eyesonly1965

RAZA - 12 May 2006 06:36 GMT
HI

THE BELOW CODE WILL SOLVE YOU PROBLEM

Private Sub TextBox1_Change()
Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
TextBox2.Value = ActiveCell.Offset(0, 1).Value

End Sub

DO LET ME KNOW IF THIS WORKS

REGARDS
RAZA

Signature

RAZA

eyesonly1965 - 12 May 2006 18:42 GMT
thanx,

the code works perfectly, it does excacly what i want.

greetings eyesonly1965;)

Signature

eyesonly1965

eyesonly1965 - 13 May 2006 07:28 GMT
the code works perfectly when the input is found in the sheet,
but when the input is not found i get an error 91 (objectvariable or
blockvariable is not set).

and then you can end the code or debug, both i don't want.
because when you push the end button you have to start all over again.
and i don't want users to push the debug button, so they can screw up
the code.

this is what i have now.

-Private Sub txtBestellingArtikelCode2_Change()

ActiveWorkbook.Sheets("artikelen").Activate
Cells.Find(What:=txtBestellingArtikelCode2.Value,
After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
txtBestellingArtikelOmschrijving2.Value = ActiveCell.Offset(0,
1).Value

End Sub-

what i want it to do with a false input is that the value of
txtBestellingArtikelOmschrijving2 is set to not known.
can anybody help me?:confused:

Signature

eyesonly1965

RAZA - 20 May 2006 12:06 GMT
Private Sub TextBox1_Change()

Set Avalue = Cells.Find(What:=TextBox1.Value, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False)
if Avalue is nothing then msgbox "Item not found" else Avalue.select
TextBox2.Value = ActiveCell.Offset(0, 1).Value

End Sub

Signature

RAZA

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.