#16
|
|||
|
|||
Thanks for your support Paul. I really appreciate it. As I have taken the task in hand, I will keep trying till I find a way to get the data as accurate as possible. Thanks for the code too man.
|
#17
|
||||
|
||||
It appears that generally the paragraphs that should be in the row above are formatted with no space above. If we use that as the trigger to move the content up then these changes to the macro might get you most of the way there. There is at least one case where the conversion didn't add a paragraph mark so that might need a manual fix
Code:
Sub FixTable2() Dim r As Long, c As Long, RngSrc As Range, RngTgt As Range, aCell As Cell With ActiveDocument.Tables(1) For r = 3 To .Rows.Count For Each aCell In .Rows(r).Cells If aCell.Range.Characters(1) = vbCr Then aCell.Range.Characters(1).Delete If aCell.Range.Paragraphs(1).SpaceBefore = 0 And aCell.Range.Paragraphs.Count > 1 Then Set RngSrc = aCell.Range.Paragraphs(1).Range RngSrc.MoveEnd Unit:=wdCharacter, Count:=-1 RngSrc.Select Set RngTgt = .Cell(r - 1, aCell.ColumnIndex).Range RngTgt.MoveEnd Unit:=wdCharacter, Count:=-1 RngTgt.InsertAfter vbCr & RngSrc.Text aCell.Range.Paragraphs(1).Range.Delete End If Next aCell Next .Rows.HeightRule = wdRowHeightAuto .Range.Paragraphs.LeftIndent = 0 .Range.Paragraphs.RightIndent = 0 .Range.Paragraphs.FirstLineIndent = 0 End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#18
|
|||
|
|||
Thanks Andrew. I will check and revert back.
|
#19
|
|||
|
|||
Andrew. I am sharing the pdf image of the statement along with the result in excel which I had to clean manually. It took around 4 hours to clean the xlsx converted sheet. I tried to convert pdf to xlsx using different online applications. But I was not able to get the result in the expected order or anywhere near it.
I decided to try and create something similar and this was the first step to copy the data from pdf to word and then the next step would follow. It tried your code too but the borders are mixing up one transaction with the other. Is it so difficult to get one line of data in one row. or maybe the format of the pdf is completely different which I am not able to understand. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to draw a trendline but not show the original line? | Sunny Rio | Word | 0 | 09-03-2022 05:55 PM |
How to draw a cross mark on a vertical line? | kingston123 | Drawing and Graphics | 4 | 09-19-2018 03:44 AM |
How to draw double line border for a Cell | phamh | PowerPoint | 2 | 10-21-2014 02:26 PM |
I draw a line, an arrow comes up instead | ZapoTeX | PowerPoint | 1 | 11-06-2012 02:03 AM |
how to draw line diagram with x yr yl | gsrikanth | Excel | 1 | 03-07-2012 05:50 AM |