+ Reply to Thread
Results 1 to 5 of 5

'If' Macro

  1. #1
    Registered User
    Join Date
    03-28-2007
    Posts
    25

    Smile 'If' Macro

    I need to change cell values according to code entered into another cell:

    For example:

    If 'A' is entered into cell A1, I would like B1 to contain 'Richard' and cell C1 to contain 'Bartram'

    If 'B' is entered into cell A1, I would like B1 to contain 'Lee' and cell C1 to contain 'Farquar'

    If 'C' is entered into cell A1, I would like B1 to contain 'Andrew' and cell C1 to contain 'Gutteridge'

    There are 21 codes for Cell A (21 possible names for B1,C1) and approx 2000 rows in column A to input a code.

    I know I can't use an IF funtion, but could anybody help with a Macro?

    Best wishes,

    James

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not use VLOOKUP?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-28-2007
    Posts
    25
    Not getting that to work effectively

  4. #4
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    James,

    Do you have your name pairs currently set up on a worksheet within the workbook? If so, then I believe you could do something similar to what we have done with your planner. As soon as a code is entered in column A it finds the code on the other sheet, grabs the names, and puts them in columns B & C. It that basically what you are wanting to do.

    You might want to post a sample like you did with your planner. That will make it a lot easier to help you.
    Sincerely,
    Jeff

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by jamessaunders
    Not getting that to work effectively
    Not very helpful, why is it not working? Have you set your data up correctly?

+ 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