Open PDF based on Cell Value

CHARRIS1

New Member
Joined
Sep 5, 2016
Messages
13
Hi All,

I am looking for a macro that will open up a pdf file based on the value of a given cell.
The macro will be run as a button, along with some other macros.

An example of my data is provided below.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Sector[/TD]
[TD]Recommendation[/TD]
[TD]Transaction[/TD]
[TD]Subsequent Holding[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]ABCD123[/TD]
[TD]ABC Fund[/TD]
[TD]A[/TD]
[TD]Retain[/TD]
[TD]$0[/TD]
[TD]$100[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EFGH123[/TD]
[TD]EFG Fund[/TD]
[TD]B[/TD]
[TD]Buy[/TD]
[TD]$100[/TD]
[TD]$100[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]IJKL123[/TD]
[TD]IJK Fund[/TD]
[TD]C[/TD]
[TD]Top-up[/TD]
[TD]$50[/TD]
[TD]$150[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]MNOP123[/TD]
[TD]MNO Fund[/TD]
[TD]D[/TD]
[TD]Sell[/TD]
[TD]-$100[/TD]
[TD]$0[/TD]
[/TR]
</tbody>[/TABLE]

Essentially I am looking to open the associated file based on whether the vale in column E is above $0.
In the above example, I would want to open the files that are associated with the EFG Fund and the IJK Fund

File locations are:
C:/Program Files/Fund Fact Sheets/"Code" Fact Sheet (e.g. ABCD123 Fact Sheet)

Now for the wish list:
1. While the data (and positioning) in columns A:C may remain relatively static, there will be scenarios where it can change, and I would love to not have to update the Macro each time this occurs. In this regard, is it possible to base a macro on looking for positive values in column E and then opening the appropriate file based on the code in column A?
2. There may also be times where there isn't a corresponding file and it would be great if an Error message comes up detailing the code it could not open a file for.
3. There are occurrences of codes in column A which have 5 characters or less. These codes will not have a corresponding file, so regardless of whether there is a positive value in column E or not, no error message is needed.

Thanks in advance for any assistance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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