Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 10-23-2022, 02:49 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

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.
Reply With Quote
  #17  
Old 10-23-2022, 11:29 PM
Guessed's Avatar
Guessed Guessed is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Does this version get you closer to the desired target?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #18  
Old 10-24-2022, 01:06 AM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

Thanks Andrew. I will check and revert back.
Reply With Quote
  #19  
Old 10-24-2022, 12:28 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

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.
Attached Images
File Type: png Original PDF.png (121.4 KB, 13 views)
Attached Files
File Type: xlsx Expected result in excel.xlsx (10.3 KB, 4 views)
Reply With Quote
Reply



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 line at every change in date in the document How to draw a cross mark on a vertical line? kingston123 Drawing and Graphics 4 09-19-2018 03:44 AM
How to Draw a line at every change in date in the document How to draw double line border for a Cell phamh PowerPoint 2 10-21-2014 02:26 PM
How to Draw a line at every change in date in the document I draw a line, an arrow comes up instead ZapoTeX PowerPoint 1 11-06-2012 02:03 AM
How to Draw a line at every change in date in the document how to draw line diagram with x yr yl gsrikanth Excel 1 03-07-2012 05:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft