ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform to search by entering data into a textbox (https://www.excelbanter.com/excel-programming/372786-userform-search-entering-data-into-textbox.html)

Moh

userform to search by entering data into a textbox
 
Hello i have a sheet with data in column A and column B

Is there a way in creating a userform that will let me type in data in a
textbox (from column a) that will bring up information from column b

e.g A1 WILL BE LINKED TO B1
A2 WILL BE LINKED TO B2
A3 WILL BE LINKED TO B3 etc.....
so i type in a word from the column A e.g Business Department then it will
bring up a telephone Number for that Business Department from column B.

Thanks
--
please can you help... its urgent

Tom Ogilvy

userform to search by entering data into a textbox
 
Private Sub Textbox1_Exit()
Dim res as Variant, rng as Range
With worksheets("sheet1")
set rng = .Range(.Cells(1,1),.Cells(1,10.End(xldown))
End with
res = Application.Match(Textbox1.Value,rng,0)
if not iserror res then
Textbox2.Value = rng(res,2).Text
else
Textbox2.Value = "Not found"
End if
End sub

--
Regards,
Tom Ogilvy






"Moh" wrote:

Hello i have a sheet with data in column A and column B

Is there a way in creating a userform that will let me type in data in a
textbox (from column a) that will bring up information from column b

e.g A1 WILL BE LINKED TO B1
A2 WILL BE LINKED TO B2
A3 WILL BE LINKED TO B3 etc.....
so i type in a word from the column A e.g Business Department then it will
bring up a telephone Number for that Business Department from column B.

Thanks
--
please can you help... its urgent


Moh

userform to search by entering data into a textbox
 
Tom,
silly question but how do i create the userform and get it activated?

Thanks
--



"Tom Ogilvy" wrote:

Private Sub Textbox1_Exit()
Dim res as Variant, rng as Range
With worksheets("sheet1")
set rng = .Range(.Cells(1,1),.Cells(1,10.End(xldown))
End with
res = Application.Match(Textbox1.Value,rng,0)
if not iserror res then
Textbox2.Value = rng(res,2).Text
else
Textbox2.Value = "Not found"
End if
End sub

--
Regards,
Tom Ogilvy






"Moh" wrote:

Hello i have a sheet with data in column A and column B

Is there a way in creating a userform that will let me type in data in a
textbox (from column a) that will bring up information from column b

e.g A1 WILL BE LINKED TO B1
A2 WILL BE LINKED TO B2
A3 WILL BE LINKED TO B3 etc.....
so i type in a word from the column A e.g Business Department then it will
bring up a telephone Number for that Business Department from column B.

Thanks
--
please can you help... its urgent


Tom Ogilvy

userform to search by entering data into a textbox
 
http://j-walk.com/ss/excel/tips/tip84.htm

See this tutorial here
http://www.dicks-blog.com/excel/2004...g_userfor.html

XL97: How to Use a UserForm for Entering Data (Q161514)
http://support.microsoft.com/?id=161514

XL2000: How to Use a UserForm for Entering Data (Q213749)
http://support.microsoft.com/?id=213749


Here are some other sources of information:

http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.

Peter Aiken Articles:
Part I
http://msdn.microsoft.com/library/en...FormsPartI.asp
Part II
http://msdn.microsoft.com/library/en...ormsPartII.asp

--
Regards,
Tom Ogilvy

"Moh" wrote:

Tom,
silly question but how do i create the userform and get it activated?

Thanks
--



"Tom Ogilvy" wrote:

Private Sub Textbox1_Exit()
Dim res as Variant, rng as Range
With worksheets("sheet1")
set rng = .Range(.Cells(1,1),.Cells(1,10.End(xldown))
End with
res = Application.Match(Textbox1.Value,rng,0)
if not iserror res then
Textbox2.Value = rng(res,2).Text
else
Textbox2.Value = "Not found"
End if
End sub

--
Regards,
Tom Ogilvy






"Moh" wrote:

Hello i have a sheet with data in column A and column B

Is there a way in creating a userform that will let me type in data in a
textbox (from column a) that will bring up information from column b

e.g A1 WILL BE LINKED TO B1
A2 WILL BE LINKED TO B2
A3 WILL BE LINKED TO B3 etc.....
so i type in a word from the column A e.g Business Department then it will
bring up a telephone Number for that Business Department from column B.

Thanks
--
please can you help... its urgent



All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com