VBA Hyperlink based on Cell Values

mielkew

New Member
Joined
Sep 14, 2015
Messages
21
2.5.0.0

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 have managed to do this in excel by Formula =Hyperlink(ColumnC&ColumnA&ColumnB,"View File"), 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 is added in the list.

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]File Name (Column A)[/TD]
[TD]File Extension (Column B)[/TD]
[TD]File Path (Column C)[/TD]
[TD]Hyperlink (Column D)[/TD]
[TD]File Location (Column E)[/TD]
[/TR]
[TR]
[TD]Drawing-0001[/TD]
[TD].pdf[/TD]
[TD]\\Issued For Acceptance\IN\[/TD]
[TD]View File[/TD]
[TD]Open Location[/TD]
[/TR]
[TR]
[TD]Drawing-0002[/TD]
[TD].pdf[/TD]
[TD]NO NATIVE FILE[/TD]
[TD]No Native File[/TD]
[TD]Blank[/TD]
[/TR]
[TR]
[TD]Drawing-0002[/TD]
[TD].pdf[/TD]
[TD]VOID CONFIDENTIAL[/TD]
[TD]Void[/TD]
[TD]Blank[/TD]
[/TR]
</tbody>[/TABLE]












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.

Any help is very much appreciated.

Thanks,
Mielkew

2.5.0.02.5.0.0
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top