Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Find criteria and return name with VB

Good day all, i got some code from this site to get the users name. It
works great, however we log in using a number e.g. QT00572, which it
returns. What i now need to do is get the users name, i have a sheet
called "names" in the file Recon_Master.xls file. When i open this file
i want the code to greet the person by name, so i must look up his name
by using his number to find the name.The visable sheet is not "Names"
sheet and i do not want to display it either.
Could somebody please give some help with this.

Thanks in advance,

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Find criteria and return name with VB


Dim sLogin As String
Dim sname
sLogin = Environ("UserName")
sname = Application.Index(Worksheets("Names").Range("B:B") , _
Application.Match(sLogin, Worksheets("Names").Range("A:A"), 0))
If Not IsError(sname) Then
MsgBox sname
End If


--

HTH

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


"Tempy" wrote in message
...
Good day all, i got some code from this site to get the users name. It
works great, however we log in using a number e.g. QT00572, which it
returns. What i now need to do is get the users name, i have a sheet
called "names" in the file Recon_Master.xls file. When i open this file
i want the code to greet the person by name, so i must look up his name
by using his number to find the name.The visable sheet is not "Names"
sheet and i do not want to display it either.
Could somebody please give some help with this.

Thanks in advance,

Tempy

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Find criteria and return name with VB

Thanks Bob,

Bob are you in the UK ?

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Find criteria and return name with VB

Yes I am, on the South Coast.

--

HTH

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


"Tempy" wrote in message
...
Thanks Bob,

Bob are you in the UK ?

Tempy

*** Sent via Developersdex http://www.developersdex.com ***



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
Return nothing if criteria is not met Gotroots Excel Worksheet Functions 7 December 9th 09 08:51 PM
EXCEL - Meet 2 criteria, then find next case of third criteria Elaine Excel Worksheet Functions 3 December 1st 08 10:43 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
How to return min, mean, max using criteria? stevenva Excel Worksheet Functions 1 November 6th 04 12:47 AM
How to return min, mean, max using criteria? stevenva Excel Worksheet Functions 1 November 5th 04 01:34 AM


All times are GMT +1. The time now is 06:39 PM.

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"