PDA

View Full Version : [SOLVED:] Automatically Hyperlink Text in a Cell, based on another Cell



DarinM
05-29-2015, 08:50 AM
Hi all,

Looking to hyperlink the words "Link to PDF" in column C, to the file location in a specific folder (always the same) with the file name being what is in column M.

is this possible?

if(C8="link to pdf") is true, hyperlink C:\\ "& M8 & ".pdf"

something like that lol.

thank you!

Kenneth Hobs
05-29-2015, 02:27 PM
=IF(M8="","",IFERROR(HYPERLINK("C:\\ "&M8&".pdf","Link to PDF"),""))

DarinM
06-01-2015, 08:33 AM
That worked great, I have been trying to edit it, to work for different folders, based on different names. I tried this, but it only works for Tom.

I get documents back from each person, and want to put them into separate folders, and still have them be linked right away when I paste the file name into a row.

This formula works good


=IF(S10="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\"&S10,"Link to PDF"),""))


Faulty formula…


=IF(C12="Tom",IF(S12="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\Tom\ (file:///\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\%60MasterTracker\NewClinicOn Board_Files\Tom\)"&S12,"Link to PDF"),IF(C12="Nicola",IF(S12="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\Nicola\ (file:///\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\%60MasterTracker\NewClinicOn Board_Files\Nicola\)"&S12,"Link to PDF"),IF(C12="Daren",IF(S12="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\Daren\ (file:///\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\%60MasterTracker\NewClinicOn Board_Files\Daren\)"&S12,"Link to PDF"),IF(C12="Annie",IF(S12="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\Annie\ (file:///\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\%60MasterTracker\NewClinicOn Board_Files\Annie\)"&S12,"Link to PDF"),IF(C12="Chris",IF(S12="","",IFERROR(HYPERLINK("\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\`MasterTracker\NewClinicOnBo ard_Files\Chris\ (file:///\\HAUCACAM0007VS\Shares\Marketing_bridge\Darin\%60MasterTracker\NewClinicOn Board_Files\Chris\)"&S12,"Link to PDF"),"")))))))))))))))

DarinM
06-02-2015, 05:45 AM
bump...

hoping to customize the formula Kenneth gave me, to be specific to certain names from a drop down in another cell.

A is the column where the hyperlinks will be activated, B is where the dropdown is and C is where the attachment is. I tried to do the if statement as shown above, but no luck, it only works for Tom, which i assume is because he is first.

appreciate it !

Kenneth Hobs
06-02-2015, 06:15 AM
The forum marked that up so I can't see what you have, exactly. You can try putting it in quote tags or attach a short example file. I don't use UNC paths nor would have the paths that you have but we can easily check to see if string concatenation built the file paths properly.

The way I debug formulas like that is to break them into parts. Try putting = in a cell and then the string (copied from your formula part) that defines the path to the file. Copy that value to a cell and then copy and paste it into your browser. If it resolved, then you built the string properly. Another thing that can help is to record a macro and view the code. When recording, select Insert button then hyperlink. Then paste your copied string. You will notice that I did not use file:// in mine.

DarinM
06-02-2015, 06:57 AM
Ah I figured it out, I tried yesterday to make it like a regular nested IF statement line but it didn't work, rethought the logic this morning and it now works.

Thanks again, I will take that advice going forward too!