DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Test89()
' Haluk - 18/05/2020
' sa4truss@gmail.com
'
Dim FSO As Object, dosya As Variant, pdfDoc As PDFDocument, pages As PDFPageCollection
Dim t As Byte
Dim RegExp As Object, RetVal As Variant
Dim txtPDF As String
Dim NoA As Integer, i As Integer
Range("B2:D" & Rows.Count) = ""
Set FSO = CreateObject("Scripting.FileSystemObject")
folderpath = ThisWorkbook.Path
Set RegExp = CreateObject("VBScript.RegExp")
RegExp.IgnoreCase = True
RegExp.MultiLine = True
RegExp.Global = True
RegExp.Pattern = "(\d{1,4})\s(Kavak)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)"
For Each dosya In FSO.GetFolder(folderpath).Files
If LCase(FSO.GetExtensionName(dosya)) = "pdf" Then
NoA = Range("B" & Rows.Count).End(xlUp).Row + 1
Set pdfDoc = New PDFDocument
Set pages = pdfDoc.OpenPdf(dosya)
For t = 0 To pages.Count - 1
txtPDF = WorksheetFunction.Trim(pages(t).GetText) & vbCrLf
i = Range("B" & Rows.Count).End(xlUp).Row
If RegExp.Test(txtPDF) Then
For Each RetVal In RegExp.Execute(txtPDF)
i = i + 1
Range("B" & i) = RetVal.Submatches(0) + 0
Range("C" & i) = RetVal.Submatches(1)
Range("D" & i) = RetVal.Submatches(2) + 0
Next
End If
Next
End If
Next
Set RegExp = Nothing
pdfDoc.ClosePdf
Set pages = Nothing
Set pdfDoc = Nothing
Set FSO = Nothing
End Sub
Sub Test90()
' Haluk - 20/05/2020
' sa4truss@gmail.com
'
Dim pdfDoc As PDFDocument, pages As PDFPageCollection
Dim t As Byte
Dim RegExp As Object, RetVal As Variant
Dim txtPDF As String
Dim NoA As Integer, i As Integer
Range("B2:D" & Rows.Count) = ""
myFile = Application.GetOpenFilename("PDF dosyaları, *.pdf")
If myFile = False Then Exit Sub
Set RegExp = CreateObject("VBScript.RegExp")
RegExp.IgnoreCase = True
RegExp.MultiLine = True
RegExp.Global = True
RegExp.Pattern = "(\d{1,4})\s(Kavak)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)\s(.+?)"
NoA = Range("B" & Rows.Count).End(xlUp).Row + 1
Set pdfDoc = New PDFDocument
Set pages = pdfDoc.OpenPdf(myFile)
i = Range("B" & Rows.Count).End(xlUp).Row
For t = 0 To pages.Count - 1
txtPDF = WorksheetFunction.Trim(pages(t).GetText) & vbCrLf
If RegExp.Test(txtPDF) Then
For Each RetVal In RegExp.Execute(txtPDF)
i = i + 1
Range("B" & i) = RetVal.Submatches(0) + 0
Range("C" & i) = RetVal.Submatches(1)
Range("D" & i) = RetVal.Submatches(2) + 0
Next
End If
Next
Set RegExp = Nothing
pdfDoc.ClosePdf
Set pages = Nothing
Set pdfDoc = Nothing
End Sub
Dosyayı indirip, denediniz mi?Haluk bey zahmet olmayacaksa .Sizi uğraştırmayacaksa yapabilir misiniz ?