+ Reply to Thread
Results 1 to 13 of 13

If / Vlookup display result not formula

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    If / Vlookup display result not formula

    Hi all,

    Hopefully you will be able to help again. Is it possible to do a vlookup that references data on other tabs within the worksheet so that the result of the formula is in the cell not the formula.

    So if my vlookup was =vlookup(a2,$a$1:$b$12,3,0) and the result was john smith i want just john smith in the cell. I know about copy and paste values but i was looking for a more automatic way. One that doesn't need intervention.

    Thanks for your help.
    Last edited by Chemistification; 12-09-2009 at 07:41 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If / Vlookup display result not formula

    Are you saying you are seeing the formula and not the result in the cell?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: If / Vlookup display result not formula

    I think I understand, you just want the result to appear without using a formula, so you want to use VBA to do this. Is this correct?

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: If / Vlookup display result not formula

    Im pretty weak on vba but if thats what it takes yes please. It shows the result in the cell which is fine but in the formula bar shows the formula behind the result. I would like it just to show the persons name ect. Thanks for your time

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: If / Vlookup display result not formula

    Quote Originally Posted by Chemistification View Post
    Im pretty weak on vba but if thats what it takes yes please. It shows the result in the cell which is fine but in the formula bar shows the formula behind the result. I would like it just to show the persons name ect. Thanks for your time
    You can if you use VBA of course, to get the result, or you can turn off the formula bar, check this out, http://excel.tips.net/Pages/T002729_...rmula_Bar.html.

    Or you can hide the cell formula. This would require protecting your sheet though.
    Right click on the cell and select format cell, go to the protection tab and check off "hidden", then protect the sheet. The formula will not show in the formula bar.

    Other preparations would have to be done to make your sheet workable though. Like unlocking all the cells that require data entry before you protect the sheet.
    Last edited by davesexcel; 12-08-2009 at 09:35 AM.

  6. #6
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: If / Vlookup display result not formula

    Thanks for the reply dave. THis is for a boss at work and i told him the bit about hiding formulas but he said he still needed the name in the cell not the formula...
    Got any good links to the vba code needed? Im ok at inserting the code into a module tho

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: If / Vlookup display result not formula

    Quote Originally Posted by Chemistification View Post
    Thanks for the reply dave. THis is for a boss at work and i told him the bit about hiding formulas but he said he still needed the name in the cell not the formula...
    Got any good links to the vba code needed? Im ok at inserting the code into a module tho
    The name would still be in the cell, nothing would appear in the formula bar.

    For the VBA Option, a link would not be required, attach a small sample workbook, so a code can be written,
    Or show what the real Vlookup Formula would be, the one in your first post seems a little off.

  8. #8
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: If / Vlookup display result not formula

    Ive attached a copy of the spreadsheet. The column in question is column Q which he has asked for me to just show [email protected] ect.

    Thanks again Dave. Cheers for taking the time
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: If / Vlookup display result not formula

    Hi,

    With VBA code to only hide formulas ... see attached ...

    HTH
    Attached Files Attached Files

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: If / Vlookup display result not formula

    I am sorry I have run out of time, here is an equivilant to your vlookup formula, using vba

    Please Login or Register  to view this content.
    Check out worksheet_change events

    The word line manager actually has a space at the end.

  11. #11
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: If / Vlookup display result not formula

    HI both,

    Thanks for your help with this. I had a little go but cant seem to get that code to work. Jean yours isnt quite what i think he is after. Instead of it showing blank in the formula bar it needs to just say the result e.g the email address.

    I will try to get the code working tomorrow. Thanks for your help

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: If / Vlookup display result not formula

    This seems to work, select the line manager name, the formulas will change to values showing the value in the formula box instead of the formula itself.
    It uses Worksheet_Change event
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: If / Vlookup display result not formula

    Hi Dave,

    Thats quality. Honestly thanks for taking the time to help me with this. Its exactly what i think he wants. I realise it would have took some time so just wanted to make cler that its appreciated.

    Thanks again,

    C

+ 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