I have a pdf file that looks like this:
The file has information concerning deliveries due from a supplier.
I want to be able to copy all of this into excel automatically using vba.
If i ctrl + a and ctrl + c this into excel, it copies and pastes into one column.
Ideally i would like to split this information out, as and when it gets pasted into excel. And have the PO-Number, Item number and quantity split across columns.
Additionally, I want to trim the item no and paste the numbers before the character '-' e.g. '000922230 - 0006' would be '000922230'. And then use the end bit of the number '0006' and paste this into column C. (This is my case size)
So the end result should look like:
Column A (PO) Column B (Item No) Column C (Case Size) Column D (Quantity)
041120121601 000922230 6 63
Please can someone show me how this is possible? I'm really sorry I'm brand new to vba and so i have only been able to do the copy and paste part of my code so far:
Sub StartAdobe()
Dim AdobeApp As String
Dim AdobeFile As String
Dim StartAdobe
AdobeApp = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
AdobeFile = "C:\users\richard\desktop\RDS\Richard Pay form.pdf"
StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
Application.OnTime Now + TimeValue("00:00:05"), "FirstStep"
End Sub
Private Sub FirstStep()
SendKeys ("^a")
SendKeys ("^c")
Application.OnTime Now + TimeValue("00:00:10"), "SecondStep"
End Sub
Private Sub SecondStep()
AppActivate "Microsoft Excel"
Range("A1").Activate
SendKeys ("^v")
End Sub
If someone could just point me in the right direction or help me get started, i'd really appreciate it. Please also note that my code requires a PDF file path to be listed, however, the pdf file will not always be saved, so if there is a way to reference open pdf file instead, this would be better.
Thanks