I have a work sheet that I have the operator click on a button, and it lets them select a pdf file. I have it so the pdf file converts to an excel table:
Private Sub CommandButton2_Click()
Dim userSelectedFile As Variant
Dim windowTitle As String
Dim fileFilter As String
Dim fileFilterIndex As Integer
Dim OpenBook As Workbook
Application.ScreenUpdating = False
windowTitle = "Choose your Gage Block Cert pdf file"
fileFilter = "PDF Files (*.pdf),*.pdf" 'Allows user to select pdf files only
'fileFilter = "PDF or Text Files (*.pdf;*.txt),*.pdf;*.txt" 'Allows user to select pdf or text files
fileFilterIndex = 1 ' For fileFilter to allow user to select pdf files only
'fileFilterIndex = 2 ' For fileFilter to allow user to select pdf or text files
userSelectedFile = Application.GetOpenFilename(fileFilter, fileFilterIndex, windowTitle)
If userSelectedFile = False Then
MsgBox "No File selected."
Exit Sub
Else
MsgBox "File selected: " & userSelectedFile
ThisWorkbook.FollowHyperlink (userSelectedFile)
End If
'Sends Commands in Adobe to create data from pdf file
Application.SendKeys "%{f}", True
Application.SendKeys "t", True
Application.SendKeys "s", True
Application.SendKeys "e", True
Application.SendKeys userSelectedFile, True
Application.SendKeys "^{ENTER}", True
Application.SendKeys "y", True
Application.SendKeys "{numlock}%s", True
Application.Wait Now + 0.0001
Now I want it to search for the table "Test Points" shown below, in the opened Workbook Table that the PDF created
I need just the numbers from under "Nominal Size", and "Final" to be copied and pasted to another worksheet labeled "GageBlockData" A1.
Can someone please help me with this?
Private Sub CommandButton2_Click()
Dim userSelectedFile As Variant
Dim windowTitle As String
Dim fileFilter As String
Dim fileFilterIndex As Integer
Dim OpenBook As Workbook
Application.ScreenUpdating = False
windowTitle = "Choose your Gage Block Cert pdf file"
fileFilter = "PDF Files (*.pdf),*.pdf" 'Allows user to select pdf files only
'fileFilter = "PDF or Text Files (*.pdf;*.txt),*.pdf;*.txt" 'Allows user to select pdf or text files
fileFilterIndex = 1 ' For fileFilter to allow user to select pdf files only
'fileFilterIndex = 2 ' For fileFilter to allow user to select pdf or text files
userSelectedFile = Application.GetOpenFilename(fileFilter, fileFilterIndex, windowTitle)
If userSelectedFile = False Then
MsgBox "No File selected."
Exit Sub
Else
MsgBox "File selected: " & userSelectedFile
ThisWorkbook.FollowHyperlink (userSelectedFile)
End If
'Sends Commands in Adobe to create data from pdf file
Application.SendKeys "%{f}", True
Application.SendKeys "t", True
Application.SendKeys "s", True
Application.SendKeys "e", True
Application.SendKeys userSelectedFile, True
Application.SendKeys "^{ENTER}", True
Application.SendKeys "y", True
Application.SendKeys "{numlock}%s", True
Application.Wait Now + 0.0001
Now I want it to search for the table "Test Points" shown below, in the opened Workbook Table that the PDF created
I need just the numbers from under "Nominal Size", and "Final" to be copied and pasted to another worksheet labeled "GageBlockData" A1.
Can someone please help me with this?