+ Reply to Thread
Results 1 to 4 of 4

Find criteria and return name with VB

  1. #1
    Tempy
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote in message
    news:%[email protected]...
    > 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. #3
    Tempy
    Guest

    Re: Find criteria and return name with VB

    Thanks Bob,

    Bob are you in the UK ?

    Tempy

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

  4. #4
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob,
    >
    > Bob are you in the UK ?
    >
    > Tempy
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1