PDF to excel conversion issue

bristolrob

New Member
Joined
Apr 23, 2018
Messages
34
I am converting a pdf to excel and encountering an issue where the conversion inserts carriage returns into a new cell below its dot entry.
Is there a way of getting the data from the carriage return back into its correct cell entry in the row above.
The conversion is on the left and what i am after is on the right

engine engine
.engine block .engine block
..exhaust manifold ..exhaust manifold 3/4inch steel
3/4inch steel ..carburettor
..carburettor ..cooling system steel tubing
..cooling system ..clutch plate
steel tubing …clutch housing solid steel plate
..clutch plate ..manifold bolts 3/4inch bolts
…clutch housing ..manifold plate
solid steel plate ..manifold cover aluminium cover plate
..manifold bolts
3/4inch bolts
..manifold plate
..manifold cover
aluminium cover plate

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
This will do what you want but assumes that there is only ever going to be one carriage return, and the first "engine" in the list is a mistake in the sample as it has no dot entry to attach it to above?

Code:
Sub FixPDF()
LastRow = Range("A" & Rows.Count).End(xlUp).Row
y = 1

For x = 1 To LastRow
    If Left(Cells(x, "A").Value, 1) = "." Then
        Cells(y, "B").Value = Cells(x, "A").Value
        y = y + 1
    Else
        y = y - 1
        Cells(y, "B").Value = Cells(x - 1, "A").Value & " " & Cells(x, "A").Value
        y = y + 1
    End If
Next x

End Sub

It looks in Column A and puts the corrected list in Column B.
 
Upvote 0
Jazz many thanks for the solution, I have tried it out and it initially looks like it works a treat.I will try it on a full spreadsheet when i am not WFH lol.N.B. the engine in the top row does not have a dot entry as it is the highest level 0, then each child has a dot entry below the parent.Many many thanks for the solution, this one has been doing my head in for a while
 
Upvote 0
No bother - Glad to help, I have to deal with mangled data all the time so am quite used to piecing things together unfortunately :-/

Can you work with this to get what you need bearing in mind the Level 0 thing?
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

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