Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2004
    Location
    Jacksonville, Florida, USA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    I have brought the output of a database into a temporary tab in Excel, and am moving selected items from that tab to another spreadsheet in the same workbook. The database spits out an employee number instead of a name, but I need to have the name on the spreadsheet. I've got a conversion table from employee number to employee name on another spreadsheet in the workbook. After I copy the employee number from the temporary tab, I want to run it against my cross reference table using vlookup, then use the output of vlookup in the spreadsheet. The pertinent code up to that part is as follows:

    Sheets ("Temp").Select
    Application.CutCopyMode = False
    Range ("B31"),Select
    Selection.Copy


    The cross reference table is on a sheet named "Links".

    Now what do I do???

    Thanks in advance for any help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Probably something like this:

    Dim strName As String
    strName = Application.WorksheetFunction.VLookup(Worksheets(" Temp").Range("B31"), Worksheets("Link").Range("A1:B100"), 2, False)

    I have assumed that:
    - The employee number is in cell B31 on sheet Test.
    - The translation table is in cells A1:B100 on sheet Links, with the employee number in the first column and the name in the second column.

Posting Permissions

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