I have a single, multi-page Adobe PDF document that I need to breakdown into individual PDFs based on a spreadsheet I have. I have Acrobat Professional X, and I can do it in Acrobat one file at a time, but was wondering if it was possible to do it with macro.

Attached is a spreadsheet with the individual group names (based on last name) and the page number ranges (beginning/ending). Is it possible to have a macro extract the page ranges for each name and save each PDF automatically in the same directory as the PDF, with each PDF file named after the group name?

PDFListing.xlsx

I have looked online and found the code below. But it only works for individual page numbers and not as automated at saving the names.

Option Explicit
Sub Extract_PDF_PageNum(control As IRibbonControl)
'extract page numbers from a selected PDF based on numbers in spreadsheet
Dim AcroPDDoc As CAcroPDDoc, fd As FileDialog
Dim lrow As Long, pages_arr, pdf_path As String, ipath As String, i As Long
Dim ColSel As Long
Dim mystr

ColSel = Selection.Columns(1).Column
lrow = Cells(Rows.Count, ColSel).End(xlUp).Row
If lrow = 1 Then Exit Sub

Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Filters.Add "PDF", "*.pdf"

If fd.Show = -1 Then pdf_path = fd.SelectedItems(1) Else Exit Sub

pages_arr = Selection

For i = LBound(pages_arr) To UBound(pages_arr)
    If IsNumeric(pages_arr(i, 1)) Then mystr = mystr & " " & pages_arr(i, 1) - 1 & " " Else mystr = mystr & " " & pages_arr(i, 1) & " "
Next

Set AcroPDDoc = CreateObject("AcroExch.PDDoc")

AcroPDDoc.Open pdf_path

For i = AcroPDDoc.GetNumPages - 1 To 0 Step -1
    If InStr(mystr, " " & i & " ") = 0 Then AcroPDDoc.DeletePages i, i
Next

ipath = Mid(pdf_path, 1, InStrRev(pdf_path, Application.PathSeparator)) & InputBox("FileName")

If AcroPDDoc.Save(PDSaveFull, ipath) = False Then
    MsgBox "Cannot save the modified document." & Chr(10) & Err.Description
    Exit Sub
Else
    MsgBox "New file is successfully created at: " & ipath & " with selected PDF file pages.", vbInformation, "Pages extraction confirmation"
End If

 End Sub