Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Search option

Hi,

I have the following situation:
I have 1 worksheet(Employees) with all the last names(Column A), First names
(Column B), phonenumbers (Column C) and location (Column D) of the employees.
I created 2 userforms with the fields Firstname, Last name and Phonenumber.
1 Userform (Searchform) where users can enter for example the first name of
the employee and press the button search.
Now the second form (Resultform) has to pop up with the First name, Last
name and phonenumber of the employee. What code is needed for this?
So what i want is to create a telephome book programm with excel.
I have searched most of the topics in this database but i can't find this.

Can somehelp me?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Search option

Something like

On Error Resume Next
iPos = Application.Match(txtLastname, Range("A:A"), 0)
On Error GoTo 0
If iPos 0 Then
MsgBox Cells(iPos, "A").Value & ", " & _
Cells(iPos, "B").Value & ", " & _
Cells(iPos, "C").Value & ", " & _
Cells(iPos, "B").Value
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Frank" wrote in message
...
Hi,

I have the following situation:
I have 1 worksheet(Employees) with all the last names(Column A), First

names
(Column B), phonenumbers (Column C) and location (Column D) of the

employees.
I created 2 userforms with the fields Firstname, Last name and

Phonenumber.
1 Userform (Searchform) where users can enter for example the first name

of
the employee and press the button search.
Now the second form (Resultform) has to pop up with the First name, Last
name and phonenumber of the employee. What code is needed for this?
So what i want is to create a telephome book programm with excel.
I have searched most of the topics in this database but i can't find this.

Can somehelp me?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Search option

Hi Bob,

Thanks for the answer, but i can't get it working: Let me explain it again:

I have two userforms
The search userform opens when the excel sheet opens. Here you can enter the
first name (or lastname) of a person and press on the search button: Now the
second userform (resultform) has to open and the first name, lastname,
phonenumber and location of this person appears in textboxes.
All the data is stored in 1 worksheet. Can you help me again?

Thanks!

"Bob Phillips" schreef:

Something like

On Error Resume Next
iPos = Application.Match(txtLastname, Range("A:A"), 0)
On Error GoTo 0
If iPos 0 Then
MsgBox Cells(iPos, "A").Value & ", " & _
Cells(iPos, "B").Value & ", " & _
Cells(iPos, "C").Value & ", " & _
Cells(iPos, "B").Value
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Frank" wrote in message
...
Hi,

I have the following situation:
I have 1 worksheet(Employees) with all the last names(Column A), First

names
(Column B), phonenumbers (Column C) and location (Column D) of the

employees.
I created 2 userforms with the fields Firstname, Last name and

Phonenumber.
1 Userform (Searchform) where users can enter for example the first name

of
the employee and press the button search.
Now the second form (Resultform) has to pop up with the First name, Last
name and phonenumber of the employee. What code is needed for this?
So what i want is to create a telephome book programm with excel.
I have searched most of the topics in this database but i can't find this.

Can somehelp me?

Thanks!




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
search option for linked data mariekek5 Excel Discussion (Misc queries) 2 June 17th 09 10:16 AM
Is the Search Option in the Discussion Web Page Not Working??? RAYCV Excel Discussion (Misc queries) 1 October 10th 08 04:26 PM
Where is advanced search option? Jennie Routley Excel Discussion (Misc queries) 0 August 30th 07 01:12 PM
Multiple Worksheet Tabs - Search Option? MRosegay Excel Worksheet Functions 1 March 21st 07 07:18 PM
Search and replace option in graphs Mr. DP Charts and Charting in Excel 5 August 14th 06 11:13 AM


All times are GMT +1. The time now is 05:48 AM.

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

About Us

"It's about Microsoft Excel"