Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search tool in userform

Status
Not open for further replies.

cken21

Technical User
Oct 19, 2011
37
Hi,

I am trying to create a search tool on a user form, i need it to search an excel sheet using one field (Text 4 characters) and have it return the data from the two adjacent cells after i click a command button. e.g

Search field:

Initials: CKKS

Returns

Manager: 1
Personnel: 123456

I am a novice with Visual basic any help would be greatly appreciated
 


So you are saying that BOTH text boxes get the value for personnel?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
No, the personnel box gets personnel but the manager/team no box is blank
 


Well than please state that.

Please COPY/PASTE the columns/rows containing the data in question like I have done with my test data below...
[tt]
Personnel Initials Manager
pers1 CKKS mgr1
6 skip y
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Personnel Initials Manager
12345 CKKS 2
23456 PBKS 1
34567 DRKS 3
 


Oh, so you also have Personnel in the column to the left of Initials and Manager in the column to the right of Initials.

What a coincidence!

When I use your data and my code, BOTH text boxes get the correct data!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
No i hadnt previously i changed that as i assumed thats the format you wanted me to have
 

I wanted you to COPY & PASTE from YOUR SHEET, without changing anything!!!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Oh i see, my bad.

Good news i have your code working fine. Thanks for all your help today i understand it may have been frustrating
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top