Solved

Advanced Macro Question

Posted on 2004-10-22
138 Views
Last Modified: 2010-05-02
Greetings,
I'm building a macro and I need some help.

Suppose I have information in Columns "A" and "B" that never change:
Column A: Suporvisor's Name
Column B: Employee Name

Now suppose I put information into Column D
Column D:  Employee Name (The names are the same names in column B, however, they might be on different rows)

I need the macro to put the proper suporvisor's name into column e.

Example:  Suzy is in cell b4.  Her suporvisor, Linda, is in cell a4.  Now suppose I type Suzy's name in cell d50.  I need Linda's name to appear in cell e50.

Thoughts?

Thanks!
John
0
Question by:dandm2003
    4 Comments
     
    LVL 8

    Expert Comment

    by:ampapa
    A simple Vlookup should work, given your supervisor and employee range is A1:B50 and you switch your columns of Supervisor and Employee:

    Cell E50's formula "=vlookup(d50,"A1:B50,2,"False")"
    0
     

    Author Comment

    by:dandm2003
    The formula works, but I forgot to ask if there is a way it can ignore if it is in CAPS for not.

    For example, everything in column B is lowercase ("Kathy"), but column D is uppercase ("KATHY")

    Any thougths?  Sorry I forgot to mention this!
    0
     
    LVL 8

    Accepted Solution

    by:
    Sure.

    This - ("Kathy") is ProperCase and not Lowercase, as a note.

    "=vlookup(proper(d50),"A1:B50,2,"False")"

    Lowercase would be:

    "=vlookup(lcase(d50),"A1:B50,2,"False")"

    One other quick note is that the data in column A should be sorted.

    0
     

    Author Comment

    by:dandm2003
    Works perfect now.  Thanks for the help!
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Cisco Complete Network Certification Training

    If you’re an IT engineer or technician, it's time you take your career to the next level. This elite training bundle is brimming with all of the information you need to learn to sit for Cisco CNNA, CCNP, and CCENT certification exams.

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    860 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now