+ Reply to Thread
Results 1 to 8 of 8

Retrieve value from a database based on another value

  1. #1
    Registered User
    Join Date
    10-13-2010
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    16

    Retrieve value from a database based on another value

    Hi all, Please I have a workbook database of Admission numbers and Names, I also have another workbook of results sheet for each student. I need a way I can link the two so that if I enter a name or Number in one cell, The corresponding Number or Name from the database will inputed in the specified cell.

    Your help will be well appreciated

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Retrieve value from a database based on another value

    Sounds like VLOOKUP should do the trick.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    10-13-2010
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Retrieve value from a database based on another value

    yeah I tot of that, but I'm just getting involved in complex programming with excel so I'll appreciate an explanation on how to write the formular or code. thanks again

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Retrieve value from a database based on another value

    See attached for an example.

    Dom
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-13-2010
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Retrieve value from a database based on another value

    Quote Originally Posted by Domski View Post
    See attached for an example.

    Dom
    Thanks man... you're a life saver

  6. #6
    Registered User
    Join Date
    10-13-2010
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Retrieve value from a database based on another value

    Forgive me for being Oliver twist....
    I've attached a sample of the result sheet I'm working with, I have subject teachers entering scores in the CAT column (each teacher is to enter the score against His subject ) for each student that I've represented on different sheets. I've locked all the formular cells so they dont get tampered with. but an issue arose, a teacher mistaking inputs his score against another subject...
    Is there a way I can create user access for each teacher and have only the cell or row for the teacher's subject editable when the teacher logs in. Hope you understand....
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-13-2010
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Retrieve value from a database based on another value

    Quote Originally Posted by Domski View Post
    See attached for an example.

    Dom
    I've been trying to play around with that formular. Now I want to be able to enter the names( combination of Name and surname from the table) in B1 and have the Id appear in B2...

    i.e B1= Charles Taylor
    B2= id of Charles(name) Taylor(surname)

    Thanks

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Retrieve value from a database based on another value

    How's this? I've used Data Validation on the input cells to restrict what can be entered, you need to give your source ranges defined names if they are on another sheet like in this example.

    About your question re limiting access could have a look at the Allow Users to Edit Ranges option on the Review tab in 2007. Other than that it would be a VBA solution but beware Excel is far from a secure system if any of this info is sensitive.

    Dom
    Attached Files Attached Files
    Last edited by Domski; 10-28-2010 at 05:05 PM.

+ 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