View Single Post
  #5  
Old April 18th, 2011, 12:33 PM
tarquinious tarquinious is offline
Experienced Member
 
First recorded activity by OfficeFrustration: Mar 2011
Posts: 34
Default

Quote:
Originally Posted by Phil View Post
I'm using the below formula to determine the specific type of equipment from
a list named: database

=IF(VLOOKUP($J$2,Database!$A:$U,21,FALSE)=$X$2,"De sktop",IF(VLOOKUP($J$2,Database!$A:$U,21,FALSE)=$X $5,"Notebook","Error!!!!!!!"))

value of X2 = DSK and value of X5 = NBK

What I need help with is a way of using the value returned to automatically
open the relevant worksheet, ie: If "Desktop" is returned the Desktop
worksheet needs to open and if "Notebook" is returned the notebook worksheet
needs to open automatically. All worksheets are in the same workbook.
I don't know if you can "Automatically" open the right worksheet based on the result if you are putting the result in multiple cells, how would a macro know which cell you're wanting the use as reference?

The following change to your existing formula will create a Hyperlink to cell A1 (change this if required) in either the worksheet "Desktop" or "Notebook" depending upon the result. You will need to change the "Book1" reference to the name of your workbook.

Code:
=IF(VLOOKUP($J$2,Database!A:U,21,FALSE)=$X$2,HYPERLINK("[Book1] Desktop!A1","Desktop"),IF(VLOOKUP($J$2,Database!$A:$U,21,FALSE)=$X$5,HYPERLINK("[Book1] Notebook!A1","Notebook"),"Error!!!!!!!"))