Macro to generate a Hyperlink with known path

caligirl626

New Member
Joined
Nov 28, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Ok, in this spreadsheet, I need a macro to generate a filepath in column Q which points to a pdf, based on the pdf's filename which will always be the "PO# in column L.pdf"
Cells Q2, Q4, and Q9 are showing examples of the final filepath, manually generated.
  • The pdfs are organized into corresponding folders on a network drive, as shown in the file explorer pic (the pic is showing the filepath of cell Q2 in the spreadsheet)
  • The location will always follow the same pattern: X:\PURCHASING\POs - Received\XXXXXX YYYYYY\XXXXXX.pdf <--Where XXXXXX is the PO# from column L.
  • "YYYYYY" is the only variable, and will change per PO#. The macro should take that into account.
  • The final request would be to Hyperlink Column L to the filepath of column Q
TIA
 

Attachments

  • Filepath.PNG
    Filepath.PNG
    46.6 KB · Views: 9
  • Spreadsheet.PNG
    Spreadsheet.PNG
    53.3 KB · Views: 9

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

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