Exported PDF to Excel need to copy data by row VBA

LNG2013

Active Member
Joined
May 23, 2011
Messages
465
I have many 100's of PDFs that I am going to be using Adobe's Acrobats function to export to excel.
In testing this has worked wonderfully.

I am now looking to pull data from these excel files.
I need help with VBA code.

First thing I did was unmerge all the cells to make it easier to find stuff.
In column A the identifier I am using to locate the desired rows to copy are numbers.
Example 1.1, 1.2, 1.3, 1.4 going until 1.9. The first digit can max out at 20, so 20.9 would be the last.
Next once located I would want to copy any of these rows to a new sheet.

THANK YOU in advance for help with any part of the code!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I got it Posting in case helpful for anyone else:


VBA Code:
Sub UnmergeandFormat()
'
' This Macro Unmerges the cells and Formats Giving a column header
'

'
    Cells.Select
    Selection.UnMerge
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Number"
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Lang"
    Rows("1:1").Select
    Selection.AutoFilter
End Sub


Sub DelBlankRows()
'Deleting so filtering works

On Error Resume Next
    Range("A2:A5000").Select
    Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete


End Sub


Sub FilterRowsAndCopy()
ActiveSheet.Range("A1").AutoFilter Field:=1, Criteria1:=">1", _
    Operator:=xlAnd, Criteria2:="<21"
     Cells.Select
    Selection.Copy
    Sheets.Add After:=Sheets(Sheets.Count)
    ActiveSheet.Paste
End Sub
 
Upvote 0
Note that in most cases, it is not necessary to "Select" ranges in order to work with them. And, selecting range usually slows the code down.
It is best to try to eliminate "Select" statements, where possible.

So sections like this:
VBA Code:
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Number"
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Lang"
can be simplified/combined to this:
VBA Code:
    Range("A1").FormulaR1C1 = "Number"
    Range("F1").FormulaR1C1 = "Lang"
 
Upvote 0
Note that in most cases, it is not necessary to "Select" ranges in order to work with them. And, selecting range usually slows the code down.
It is best to try to eliminate "Select" statements, where possible.

So sections like this:
VBA Code:
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Number"
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Lang"
can be simplified/combined to this:
VBA Code:
    Range("A1").FormulaR1C1 = "Number"
    Range("F1").FormulaR1C1 = "Lang"
Thank you for the tip!
 
Upvote 0

Forum statistics

Threads
1,214,397
Messages
6,119,271
Members
448,882
Latest member
Lorie1693

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