VBA to Combine PDFs based on Yes/No Criteria

bxp265

New Member
Joined
Jun 26, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi,

I am new to VBA and excel macros. I have an excel document that is set up so column "A" contains hyperlinks to PDFs. In column "I" there is a yes or no. If there is a yes, then I want the PDF in column A to be added to a master PDF document. The idea is that this master PDF document contains all PDFs for which there was a "yes" in column "l".

Does this make sense and can anyone help me? I have successfully written a macro for each PDF to open individually, but I have not been able to merge them or print them. Any help would be MUCH appreciated.
 
Do you mean that reference isn't listed? The code requires Acrobat Professional to be installed and then the reference will be listed.
It just won't let me click "reference" but it is probably because I do not have professional. Do you think that's the only way to get it to work?
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
As cortexnotion pointed out, you need Acrobat, not the Reader. If you don't have it, you can't use the code.
 
Upvote 0
I can still not get this to work. Below is the code I am using that opens up all of my linked PDFs in individual tabs on the OneDrive that I have them saved to. It works great. Does anyone know what I need to add to get them to combine into one PDF?

Sub OpenPDF()
'
' Macro Macro
'
Dim i As Long
' Go through the Print PDF column
For i = 2 To 28
' Check if Print PDF column is yes
If Sheet2.Range("J" & i).Value = "Yes" Or Sheet2.Range("J" & i).Value = "yes" Then
' Check if column A has hyperlink
If Range("A" & i).Hyperlinks.Count > 0 Then
'Click on hyperlink in column A if it exists
Sheet2.Range("A" & i).Hyperlinks(1).Follow
End If
Else
End If
Next

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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