+ Reply to Thread
Results 1 to 2 of 2

If, Then, vba, help

  1. #1
    Registered User
    Join Date
    12-29-2008
    Location
    united, states
    MS-Off Ver
    Excel 2003
    Posts
    18

    If, Then, vba, help

    ok i have a long list of id numbers (including duplicates). They are employee ID numbers. i have taken the list, copied it to a new worksheet, removed the duplicates and attached the corresponding job titles beside this list. What would be the best way to apply the job titles to the longer list? could i do this in a cell formula or would this take a case statement or IF statement in VBA?

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: If, Then, vba, help

    This sounds very straight forward. I would opt for using a look up formula. Built-in functions are always faster (mostly) than tacking on VBA to loop through cells.

    You didn't provide any details about the sheet structure, but if you put the job titles to the left of the ID numbers you can use VLOOKUP and quickly fill the formula down the column by double-clicking the fill-handle of the cell pointer. So, if column-A holds the ID, place the look up formula in column-B and double-click the fill handle and Excel will automatically fill down as many rows as there are in column-A that contain values.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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