Hello Guys,

Can someone help me make a VBA code that will automatically add hyperlink to columns D & E. Given the information provided in Column A, B & C?

Also, I have several worksheet in one workbook, in this case the below data is from sheet name called "Drawing". I want the VBA code to automatically add in column D & E whenever the user hit the data refresh button, is it possible to define the exact worksheet in workbook where the VBA should run?

I have managed to do this in excel by Formula as per below, however, there are user which is less familiar in excel and unintentionally deleting the formula by mistake. I want the VBA code to insert hyperlink whenever data is available and add new hyperlink when new item/data is added in the list.

Column D = if(ColumnC="No Native File","No Native File",if(ColumnC="Void Confidential","Void",Hyperlink(ColumnC&ColumnA&ColumnB,"View File")
Column E = if(ColumnC="No Native File","",if(ColumnC="Void Confidential","",Hyperlink(ColumnC&ColumnA,"Open Location")

File Name (Column A) - Drawing-0001
File Extension (Column B) - .pdf
File Path (Column C)- C:\Desktop\Test\
Hyperlink (Column D) - Text to display “View File”
File Location (Column E) - Text to display “Open Location”

Please see photo for sample data.

I use PowerQuery to load/update the data in the user template but the hyperlink is always my problem. Because sometime the user by mistake clicking inside the cell instead of clicking the text "View File" eventually deleting the formula by mistake. Please HELP ME guys.

Any help is very much appreciated.

Click image for larger version. 

Name:	IMG_0562.jpg 
Views:	16 
Size:	10.8 KB 
ID:	8823

Sent from my iPhone using Tapatalk