Convert csv to xlsx

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello code experts,
I have this csv file which was converted from pdf. The columns are not in one order to get the data in a columnar view. It will take more than a hour to arrange each line in a particular format. JohnnyL's code has helped me a lot to get the columns in order in less than a second. I am facing one problem in one of the conversions. The code is not able to concatenate the Cheque No. to the Description in 3 different rows and in one of the lines it is not taking the amount. Hence the balances are not matching. I have colored the lines with errors. Need your expertise to correct the code. Thanks.
Conver CSV to XLSX.xlsm
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
If it is December file the dates from 1 to 12th of the month the dates display mm-dd-yyyy and the rest are good dd-mm-yyyy. It depends on the month of the file. I hope you are understanding.
 
Upvote 0
Working csv to xlsx convertor 22.02.2022.xlsm
B
10913-04-2021
11013-04-2021
11113-04-2021
11213-04-2021
11313-04-2021
11413-04-2021
11513-04-2021
11613-04-2021
11704-12-2021
11804-12-2021
11904-12-2021
12004-12-2021
12104-12-2021
12204-12-2021
12304-12-2021
12404-12-2021
12504-12-2021
12604-12-2021
12704-12-2021
12804-11-2021
12904-11-2021
13004-11-2021
13104-11-2021
13204-11-2021
13304-11-2021
13404-11-2021
13504-11-2021
13604-11-2021
13704-10-2021
13804-09-2021
13904-09-2021
14004-09-2021
14104-09-2021
14204-09-2021
14304-08-2021
14404-08-2021
14504-08-2021
14604-08-2021
14704-08-2021
14804-08-2021
14904-07-2021
15004-07-2021
15104-07-2021
15204-07-2021
15304-06-2021
15404-06-2021
15504-05-2021
15604-05-2021
15704-05-2021
15804-05-2021
15904-05-2021
16004-05-2021
16104-05-2021
16204-05-2021
16304-05-2021
16404-05-2021
16504-03-2021
16604-03-2021
16704-03-2021
16804-03-2021
16904-02-2021
17004-02-2021
17104-02-2021
17204-02-2021
17304-02-2021
JohnnyL


Check this. These are the dates of April as the result of the code. Till the 116th row they are correct and below that the day and month have interchanged.
 
Upvote 0
It's a common occurrence, any day > 12 will be fine, the others will be reversed. Will have a look this afternoon.
 
Upvote 0
Here is the latest version of code I came up with. It is basically a hybrid of previous code posted here. Probably not the most eloquent way to handle the situation but it seems to work. It loads the CSV file to get the dates, so Excel can't mess with the dates, then it loads the CSV file into Excel to get the rest of the data. That approach slows the performance quite a bit. Roughly about a 400% increase in time. The actual time involved though should still be under 1/2 second:

VBA Code:
Sub LoadCSV_FileTest4()
'
    Dim startTime                       As Single
    Dim CSV_FileToOpen                  As Variant
'
    CSV_FileToOpen = Application.GetOpenFilename("Text files,*.csv", , "Select file", , False)  ' Save full path of CSV file to CSV_FileToOpen
    If CSV_FileToOpen = False Then                                                              ' If user cancelled then ...
        MsgBox "No file selected - exiting"                                                     '   Display message box to user indicating the cancellation
        Exit Sub                                                                                '   Exit the sub
    End If
'
    startTime = Timer                                                                           ' Start the stopwatch
'
    Application.ScreenUpdating = False                                                          ' Turn ScreenUpdating off
'
    Dim CSV_ColumnMinus1                As Long, CSV_FileArrayColumn        As Long, CSV_FileArrayRow   As Long, CSV_FileRow    As Long
    Dim jLeft                           As Long, jCntMid                    As Long, jRight             As Long
    Dim DatesArrayRow                   As Long
    Dim FreeFileNumber                  As Long
    Dim OutputArrayColumn               As Long, OutputArrayRow             As Long
    Dim RowNumber                       As Long
    Dim BranchName                      As String, ChequeNumber             As String
    Dim All_CSV_RowsFromCSV_FileArray   As Variant, CSV_FileRowColumnsArray As Variant, Partitioned_CSV_FileArray               As Variant
    Dim DatesArray                      As Variant, HeaderArray             As Variant, OutputArray()                           As Variant
    Dim destSht                         As Worksheet
'
    Set destSht = ThisWorkbook.Worksheets("JohnnyL")                                            ' <--- Set this to the desired sheet name
'
    FreeFileNumber = FreeFile                                                                   ' Get an unused file number
    Open CSV_FileToOpen For Input As #FreeFileNumber
'
    If Err.Number <> 0 Then                                                                     ' If error occurred then ...
        MsgBox "File open error #" & Err.Number & "!", vbCritical, "Error!"                     '   Display error #
        Exit Sub                                                                                '   Exit sub
    End If
'
    All_CSV_RowsFromCSV_FileArray = Split(Input(LOF(FreeFileNumber), #FreeFileNumber), vbCrLf)  ' Load all Rows in csv file to All_CSV_RowsFromCSV_FileArray
    Close #FreeFileNumber                                                                       ' Close the csv file
'
    RowNumber = 0                                                                               ' Initialize RowNumber
'
    ReDim Partitioned_CSV_FileArray(1 To UBound(All_CSV_RowsFromCSV_FileArray), 1 To 100)       ' Set rows/columns for Partitioned_CSV_FileArray
'
    For CSV_FileRow = LBound(All_CSV_RowsFromCSV_FileArray) To UBound(All_CSV_RowsFromCSV_FileArray)    ' Loop through all rows of CSV file
        If All_CSV_RowsFromCSV_FileArray(CSV_FileRow) <> vbNullString Then                              '   If CSV row is not blank then ...
            CSV_FileRowColumnsArray = Split(All_CSV_RowsFromCSV_FileArray(CSV_FileRow), ",")            '       Load contents of row to CSV_FileRowColumnsArray
'
            RowNumber = RowNumber + 1                                                                   '       Increment RowNumber
'
            For CSV_ColumnMinus1 = LBound(CSV_FileRowColumnsArray) To UBound(CSV_FileRowColumnsArray)   '       Loop through csv columns
                Partitioned_CSV_FileArray(RowNumber, CSV_ColumnMinus1 + 1) = _
                        CSV_FileRowColumnsArray(CSV_ColumnMinus1)                                       '           Save values to Partitioned_CSV_FileArray
            Next                                                                                        '       Loop back
        End If
    Next                                                                                                ' Loop back
'
'   All values from the CSV File are now loaded into Partitioned_CSV_FileArray
'
'-----------------------------------------------------------------------------------------------------
'
'   Intercept CSV file dates before excel gets it's hands on them
'
    ReDim DatesArray(1 To UBound(Partitioned_CSV_FileArray, 1))                                 ' Set # of rows for DatesArray
'
    DatesArrayRow = 0                                                                           ' Initialize DatesArrayRow
'
    For CSV_FileArrayRow = 1 To UBound(Partitioned_CSV_FileArray, 1)                            ' Loop through Partitioned_CSV_FileArray rows
        If IsNumeric(Right(Partitioned_CSV_FileArray(CSV_FileArrayRow, 1), 6)) Then             '   If transaction # found then ...
            DatesArrayRow = DatesArrayRow + 1                                                   '       Increment DatesArrayRow
'
            For CSV_FileArrayColumn = 2 To UBound(Partitioned_CSV_FileArray, 2)                 '       Loop through csv file columns starting from 2nd column
                If Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn) <> "" Then  '           If a value is found then ...
                    DatesArray(DatesArrayRow) = Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn)    '            Save the date into DatesArray
                    Exit For                                                                                        '            Exit loop
                End If
            Next                                                                                                    '       Loop back
        End If
    Next                                                                                                            ' Loop back
'
'   Dates needed are now safely stored into DatesArray
'
'-------------------------------------------------------------------------------------------------
'
    Workbooks.Open Filename:=CSV_FileToOpen                                                     ' Open the CSV file into Excel
'
    Partitioned_CSV_FileArray = ActiveWorkbook.ActiveSheet.UsedRange.Value                      ' Save the values from CSV file into Partitioned_CSV_FileArray
'
    ReDim OutputArray(1 To UBound(Partitioned_CSV_FileArray, 1), 1 To 5)                        ' Set rows/columns for OutputArray
'
    OutputArrayRow = 1                                                                          ' Initialize OutputArrayRow
'
    For CSV_FileArrayRow = 1 To UBound(Partitioned_CSV_FileArray, 1)                            ' Loop through rows of Partitioned_CSV_FileArray
        If IsNumeric(Right(Partitioned_CSV_FileArray(CSV_FileArrayRow, 1), 6)) Then             '   If transaction # found then ...
            OutputArrayColumn = 0                                                               '       Initialize OutputArrayColumn
'
            For CSV_FileArrayColumn = 2 To UBound(Partitioned_CSV_FileArray, 2)                 '       Loop through columns of Partitioned_CSV_FileArray
                If Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn) <> "" Then  '           If value found then ...
                    OutputArrayColumn = OutputArrayColumn + 1                                   '               Increment OutputArrayColumn
'
                    If OutputArrayColumn = 2 Then                                               '               If 'Description' is found then ...
                        OutputArray(OutputArrayRow, OutputArrayColumn - 1) = _
                                Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn)    '                   Save it into OutputArray Column 1
                    End If
'
                    If OutputArrayColumn = 3 Then                                               '               If 4th value in row found then ...
                        If Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn) <> "-" Then '                       If value found <> '-' then ...
                            BranchName = Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn)   '                       save it into BranchName
                        End If
'
                        jLeft = CSV_FileArrayColumn + 1                                         '                   Set col # to next ie. col 29->30
                        Exit For                                                                '                   Exit column loop
                    End If
                End If
            Next                                                                                '       Loop back
         
            For CSV_FileArrayColumn = UBound(Partitioned_CSV_FileArray, 2) To jLeft Step -1     '       Loop backwards from last column of csv to 4th value found column + 1
                If Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn) <> "" Then  '           If a value is found then ...
                    OutputArray(OutputArrayRow, 5) = _
                            Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn)    '               Save the value to Column 5 of OutputArray
                    OutputArray(OutputArrayRow, 4) = _
                            Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn - 1)    '           Save Cr amount to column 4 of OutputArray
                    OutputArray(OutputArrayRow, 3) = _
                            Partitioned_CSV_FileArray(CSV_FileArrayRow, CSV_FileArrayColumn - 3)    '           Save Dr amount to column 3 of OutputArray
'
                    If OutputArray(OutputArrayRow, 3) <> vbNullString Then _
                            OutputArray(OutputArrayRow, 2) = "Payment"                          ' If OutputArray column 3 is not blank then set "Payment"
                    If OutputArray(OutputArrayRow, 4) <> vbNullString Then _
                            OutputArray(OutputArrayRow, 2) = "Receipt"                          ' If OutputArray column 4 is not blank then set "Receipt"
'
                    jRight = CSV_FileArrayColumn - 3 - 1
                    Exit For                                                                    ' Exit loop
                End If
            Next
        
            For jCntMid = jLeft To jRight                                                       ' Loop through columns for a cheque # value between the
'                                                                                               '       Branch Name column and the DR/CR amount column
                 If Partitioned_CSV_FileArray(CSV_FileArrayRow, jCntMid) <> "" Then             '   If cheque # found then ...
                    ChequeNumber = Partitioned_CSV_FileArray(CSV_FileArrayRow, jCntMid)         '       Save the cheque # into ChequeNumber
                    Exit For                                                                    '       Exit loop
                 End If
            Next
'
            OutputArray(OutputArrayRow, 1) = OutputArray(OutputArrayRow, 1) & _
                    " Txn No." & Partitioned_CSV_FileArray(CSV_FileArrayRow, 1)                 ' Append Transaction # to column 1 of OutputArray
'
            If BranchName <> "" Then OutputArray(OutputArrayRow, 1) = _
                    OutputArray(OutputArrayRow, 1) & " Branch Name - " & BranchName             ' If a BranchName was found then Append BranchName to column 1 of OutputArray
'
            If ChequeNumber <> "" Then OutputArray(OutputArrayRow, 1) = _
                    OutputArray(OutputArrayRow, 1) & " Cheque No. " & ChequeNumber              ' If a ChequeNumber was found then Append ChequeNumber to column 1 of OutputArray
'
            OutputArray(OutputArrayRow, 1) = Replace(OutputArray(OutputArrayRow, 1), Chr(10), "")   ' delete line feeds in description
'
            OutputArrayRow = OutputArrayRow + 1                                                 ' Increment OutputArrayRow
            BranchName = ""                                                                     ' Clear BranchName
            ChequeNumber = ""                                                                   ' Clear ChequeNumber
        End If
    Next
 
    HeaderArray = Array("Txn Date", "Description", "Voucher Type", "Dr Amount", "Cr Amount", "Balance") ' Establish HeaderArray

    With destSht
        .UsedRange.Clear                                                                        ' Clear the destination sheet
        .Columns("A:A").NumberFormat = "@"                                                      ' Set column A to text so Excel don't mess up the dates
        .Range("A1").Resize(, UBound(HeaderArray) + 1) = HeaderArray                            ' Write the Header columns to destination sheet
        .Range("A1").Resize(, UBound(HeaderArray) + 1).Font.Bold = True                         ' Set the Header to Bold type font
'
        .Range("A2").Resize(UBound(DatesArray)).Value = Application.Transpose(DatesArray)       ' Display the dates to destination sheet Column A
'
        .Range("B2").Resize(UBound(OutputArray, 1), UBound(OutputArray, 2)).Value = OutputArray ' Display other results to destination sheet column B
'
''        .Range("F:H").EntireColumn.NumberFormat = "_(* #,##0.00_);[Red]_(* (#,##0.00);;_(@_)"   ' Amount fields
        .UsedRange.Columns.AutoFit                                                              ' Resize the columns to fit the data
    End With
'
    Application.DisplayAlerts = False
    ActiveWorkbook.Close SaveChanges:=False                                                     ' Close the csv file that was opened earlier
    Application.DisplayAlerts = True
'
    Application.ScreenUpdating = True                                                           ' Turn ScreenUpdating back on
'
    Debug.Print "Time to complete = " & Timer - startTime & " seconds."                         ' about .4 seconds
End Sub

Maybe someone else can suggest a better way than my caveman attack I employed.


Results:

CopyOfConver CSV to XLSX_VBA_Pasworded.xlsm
ABCDEFG
1Txn DateDescriptionVoucher TypeDr AmountCr AmountBalance
231-01-20220040008700003314:Int.Coll:01-01-2022 to 31-01-202 Txn No.S69538859Payment2022682,01,94,803.55 Dr.
331-01-2022N PRAKASH Txn No.S55291435 Cheque No. 115927Payment258001,99,92,535.55 Dr.
431-01-2022SRD LOGISTICS PRIVATELIM Txn No.S55190966 Cheque No. 297840Payment30631,99,66,735.55 Dr.
531-01-2022To:0040000400037211:ABALU Txn No.S52946961Payment120001,99,63,672.55 Dr.
631-01-2022NEFT_OUT:PUNBH22031771064/AEBC376932184342/SCBL0036020/52205899087 Txn No.S52937494Payment200001,99,51,672.55 Dr.
731-01-2022NEFT_OUT:PUNBH22031771036/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S52931538Payment250001,99,31,672.55 Dr.
831-01-2022NEFT_OUT:PUNBH22031771000/JagdambaFurnishi/HDFC0001416/50200011850889 Txn No.S52922892Payment468201,99,06,672.55 Dr.
931-01-2022IMPS-IN/203108352889/9008333000/SUMIT KU Txn No.S52914499Receipt1000001,98,59,852.55 Dr.
1031-01-2022To:0335002100027863:MAYUR TEX Txn No.S52818356Payment300001,99,59,852.55 Dr.
1131-01-2022To:0573008700001276:MAGMA FINCORP LIMITED Txn No.S52811577Payment107551,99,29,852.55 Dr.
1231-01-2022To:0040000400022033:THIRDPARTY Txn No.S52803831Payment60001,99,19,097.55 Dr.
1331-01-2022NEFT_OUT:PUNBH22031770116/Deutsche Bank/DEUT0784PBC/350032923110028 Txn No.S52791765Payment450001,99,13,097.55 Dr.
1431-01-2022NEFT_OUT:PUNBH22031769901/Indusind BankLtd/INDB0000007/00073564614017 Txn No.S52749740Payment259931,98,68,097.55 Dr.
1531-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S52731921Receipt1000001,98,42,104.55 Dr.
1631-01-2022NEFT_OUT:PUNBH22031769728/Sumit Kumar/KKBK0000631/CSG152957522 Txn No.S52731878Payment750561,99,42,104.55 Dr.
1731-01-2022NEFT_OUT:PUNBH22031769695/Shivanaa Homes/ICIC0000052/005205009149 Txn No.S52731762Payment350001,98,67,048.55 Dr.
1830-01-2022To:0040000400017794:THIRDPARTY Txn No.S49617550Payment25001,98,32,048.55 Dr.
1930-01-2022To:0040000400022033:THIRDPARTY Txn No.S49606885Payment150001,98,29,548.55 Dr.
2030-01-2022NEFT_OUT:PUNBH22030760882/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S49228683Payment12901,98,14,548.55 Dr.
2130-01-2022NEFT_OUT:PUNBH22030760842/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S49210304Payment18501,98,13,258.55 Dr.
2230-01-2022NEFT_OUT:PUNBH22030760788/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S49192306Payment14001,98,11,408.55 Dr.
2330-01-2022To:0040002100096132:SAIPRIYADARSHINI Txn No.S49135071Payment150001,98,10,008.55 Dr.
2430-01-2022NEFT_OUT:PUNBH22030760012/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S48741255Payment28901,97,95,008.55 Dr.
2530-01-2022NEFT_OUT:PUNBH22030759984/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S48727027Payment26001,97,92,118.55 Dr.
2630-01-2022NEFT_OUT:PUNBH22030759942/Surya Prints/HDFC0000926/09262320000091 Txn No.S48704812Payment262401,97,89,518.55 Dr.
2730-01-2022NEFT_OUT:PUNBH22030759904/Kapish Fabrics/BARB0PANCHK/03340500014101 Txn No.S48681378Payment200001,97,63,278.55 Dr.
2830-01-2022NEFT_OUT:PUNBH22030759834/SG Textiles/UBIN0540242/402405010000124 Txn No.S48639497Payment200001,97,43,278.55 Dr.
2930-01-2022NEFT_OUT:PUNBH22030759414/Anjali Textiles/DCBL0000191/19122900003933 Txn No.S48390952Payment250001,97,23,278.55 Dr.
3030-01-2022NEFT_OUT:PUNBH22030759359/Jai BharatPrints/HDFC0000926/50200017200515 Txn No.S48373944Payment500001,96,98,278.55 Dr.
3130-01-2022To:4365002100104033:S BENTERPRISES Txn No.S48332081Payment180001,96,48,278.55 Dr.
3230-01-2022NEFT_OUT:PUNBH22030759225/Rubmini Fabrics/UBIN0904597/560101000102178 Txn No.S48299812Payment250001,96,30,278.55 Dr.
3330-01-2022IMPS-IN/203016277937/9743495430/NAGARAJA Txn No.S45137001Receipt27271,96,05,278.55 Dr.
3430-01-2022NEFT_OUT:PUNBH22030738693/SM EXPRESSLOGIST/HDFC0001471/14712560000622 Txn No.S39147626Payment179041,96,08,005.55 Dr.
3530-01-2022To:1456002100112933:TANISHQ FAB Txn No.S39064636Payment107901,95,90,101.55 Dr.
3630-01-2022NEFT_OUT:PUNBH22030738330/Dhruv Industries/HDFC0002707/50200008690824 Txn No.S39001769Payment475951,95,79,311.55 Dr.
3730-01-2022NEFT_OUT:PUNBH22030738290/K B TEXFAB PVTLT/UBIN0539287/392801010050845 Txn No.S38978925Payment472041,95,31,716.55 Dr.
3830-01-2022NEFT_OUT:PUNBH22030738265/DR DRAPES/KKBK0000961/8011205001 Txn No.S38966951Payment347911,94,84,512.55 Dr.
3930-01-2022NEFT_OUT:PUNBH22030738240/Das Furnishing/FDRL0001546/15460200009412 Txn No.S38957395Payment412341,94,49,721.55 Dr.
4030-01-2022NEFT_OUT:PUNBH22030738195/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S38943508Payment371281,94,08,487.55 Dr.
4130-01-2022NEFT_OUT:PUNBH22030738146/ShyamInnovations/KKBK0001435/0413090674 Txn No.S38927953Payment231371,93,71,359.55 Dr.
4230-01-2022NEFT_OUT:PUNBH22030738112/Ronak Kothari/SIBL0000008/0008053000019810 Txn No.S38918271Payment990001,93,48,222.55 Dr.
4329-01-2022To:3616002100032433:SHRIRAVI TEXTILES Txn No.S36568018Payment200001,92,49,222.55 Dr.
4429-01-2022NEFT_OUT:PUNBH22029724591/Deutsche Bank/DEUT0784PBC/350032923110028 Txn No.S35546415Payment530001,92,29,222.55 Dr.
4529-01-2022NEFT_OUT:PUNBH22029669930/Bajrang Textile/SBIN0016970/36189935432 Txn No.S31710586Payment272701,91,76,222.55 Dr.
4629-01-2022NEFT_OUT:PUNBH22029571773/SnehaEnterprises/KARB0000715/7157000600342001 Txn No.S29261280Payment200001,91,48,952.55 Dr.
4729-01-2022NEFT_IN:CMS2368136936/0028/ NEFT SAIPRIYADARSHINI PNB Txn No.S28662620Receipt112261,91,28,952.55 Dr.
4829-01-2022To:0040005500052250:SAIPRIYADARSHINI Txn No.S28330610Payment1600001,91,40,178.55 Dr.
4929-01-2022NRTGS/SIBLR52022012900217708/RONAK KOTHARI Txn No.S27350940Receipt10000001,89,80,178.55 Dr.
5029-01-2022SAAKAN Txn No.S25594848 Cheque No. 404451Payment358051,99,80,178.55 Dr.
5129-01-2022NEFT_IN:0129i27266126981/0020/ HARYANAHANDLOOM CENTRE Txn No.S24127932Receipt141571,99,44,373.55 Dr.
5228-01-2022To:0335002100027863:MAYUR TEX Txn No.S21652886Payment250001,99,58,530.55 Dr.
5328-01-2022NEFT_OUT:PUNBH22028444122/Ambujammal GadiC/UBIN0533114/004600101009347 Txn No.S21649604Payment250001,99,33,530.55 Dr.
5428-01-2022IMPS-IN/202823229653/9008333000/HIT KARA Txn No.S21646457Receipt500001,99,08,530.55 Dr.
5528-01-2022To:0040000400022033:THIRDPARTY Txn No.S20078016Payment650001,99,58,530.55 Dr.
5628-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S20048431Receipt140001,98,93,530.55 Dr.
5728-01-2022IMPS-IN/202820202905/9008333000/HIT KARA Txn No.S19855554Receipt300001,99,07,530.55 Dr.
5828-01-2022NEFT_OUT:PUNBH22028407183/Balwant Sharma/CSBK0000009/000901014064190001 Txn No.S17122507Payment50001,99,37,530.55 Dr.
5928-01-2022NEFT_OUT:PUNBH22028406780/VRL LogisticsLtd/SVCB0000151/115104180000724 Txn No.S17099015Payment8901,99,32,530.55 Dr.
6028-01-2022NEFT_IN:CMS2366034725/0028/ NEFT SAIPRIYADARSHINI PNB Txn No.S12552876Receipt100791,99,31,640.55 Dr.
6128-01-2022BY INST 9 : CTO386-1 DAYLAT Txn No.S11116242Receipt413631,99,41,719.55 Dr.
6228-01-2022BY INST 700 : CTO386-1DAY LAT Txn No.S11116242Receipt79451,99,83,082.55 Dr.
6328-01-2022IW CHQ : 115925 REJ Txn No.S9240214Payment2361,99,91,027.55 Dr.
6428-01-2022DHC LOGISTICS PVT LTD Txn No.S8610328 Cheque No. 297841Payment29201,99,90,791.55 Dr.
6527-01-2022DEEPIKLA TEXTILES-097710 Txn No.M698300 Branch Name - AMRITSAR-RANJITAVENUE Cheque No. 115915Payment239401,99,87,871.55 Dr.
6627-01-2022NEFT_IN:000467863512/0028/ DEVI FURNISHING Txn No.S95873762Receipt34981,99,63,931.55 Dr.
6727-01-2022DHC LOGISTICS PVT LTD Txn No.S92312801 Cheque No. 297836Payment42291,99,67,429.55 Dr.
6826-01-2022NEFT_OUT:PUNBH22026706732/K B TEXFAB PVTLT/UBIN0539287/392801010050845 Txn No.S83749201Payment200001,99,63,200.55 Dr.
6926-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S83734339Receipt50001,99,43,200.55 Dr.
7026-01-2022From:0040000400022033:RAJ KUMAR Txn No.S83672401Receipt150001,99,48,200.55 Dr.
7126-01-2022To:0040000400022033:THIRDPARTY Txn No.S75113303Payment50001,99,63,200.55 Dr.
7226-01-2022To:0040000400017800:THIRDPARTY Txn No.S75105575Payment40001,99,58,200.55 Dr.
7326-01-2022NEFT:PUNBH22026679338/5074103288/Vrindavan Creatio Txn No.S75105463Payment111451,99,54,200.55 Dr.
7425-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S75105293Receipt150001,99,43,055.55 Dr.
7525-01-2022NEFT_OUT:PUNBH22025679303/Das furnishing/FDRL0001546/15465500000540 Txn No.S75097199Payment150001,99,58,055.55 Dr.
7625-01-2022NEFT_OUT:PUNBH22025679297/Haji Hamza Cloth/BARB0PILAKH/37090200000553 Txn No.S75097098Payment100001,99,43,055.55 Dr.
7725-01-2022NEFT_OUT:PUNBH22025679273/P Rosy/UBIN0902802/520101073176733 Txn No.S75096946Payment66381,99,33,055.55 Dr.
7825-01-2022NEFT_OUT:PUNBH22025679255/Reshma Firdose/IOBA0002838/283801000002794 Txn No.S75096820Payment30001,99,26,417.55 Dr.
7925-01-2022To:0335002100027863:MAYUR TEX Txn No.S73759969Payment500001,99,23,417.55 Dr.
8025-01-2022To:0040000400022033:THIRDPARTY Txn No.S73539862Payment500001,98,73,417.55 Dr.
8125-01-2022NEFT_OUT:PUNBH22025665078/Dhruv Industries/HDFC0002707/50200008690824 Txn No.S72354267Payment226001,98,23,417.55 Dr.
8225-01-2022NEFT_OUT:PUNBH22025664748/Guru Kirpa Texco/HDFC0001419/50200015879735 Txn No.S72305292Payment163491,98,00,817.55 Dr.
8325-01-2022NEFT_OUT:PUNBH22025664529/Sumit Kumar/HDFC0000076/50100453150353 Txn No.S72269403Payment250001,97,84,468.55 Dr.
8425-01-2022NEFT_OUT:PUNBH22025654362/MK Fab and FurnP/CNRB0000422/0422201002863 Txn No.S71145240Payment84631,97,59,468.55 Dr.
8525-01-2022JAI SHRI KRISHANHANDLOO Txn No.S64604285 Cheque No. 404458Payment150001,97,51,005.55 Dr.
8625-01-2022IW CHQ : 404450 REJ Txn No.S64576849Payment2361,97,36,005.55 Dr.
8725-01-2022BY INST 8 : CTO386-1 DAYLAT Txn No.S64215257Receipt300001,97,35,769.55 Dr.
8825-01-2022BY INST 6228 : CTO386-1DAY LAT Txn No.S64215257Receipt86921,97,65,769.55 Dr.
8925-01-2022BY INST 2310 : CTO386-1DAY LAT Txn No.S64215257Receipt27301,97,74,461.55 Dr.
9025-01-2022BY INST 13778 : CTO386-1DAY LAT Txn No.S64215257Receipt2000001,97,77,191.55 Dr.
9125-01-2022SHORTFAL REC- Inw RtrnChrgs:404449 Txn No.S59088095Payment2361,99,77,191.55 Dr.
9221-01-2022OW CHQ : 28600 REJ Txn No.S8826093Payment1771,99,76,955.55 Dr.
9321-01-2022REJECT:28600:FUNDSINSUFFICIENT Txn No.S8055280Payment138601,99,76,778.55 Dr.
9421-01-2022BY INST 28600 : CTO386-1DAY LAT Txn No.S6117680Receipt138601,99,62,918.55 Dr.
9521-01-2022BY INST 5020 : CTO386-1DAY LAT Txn No.S6117680Receipt180001,99,76,778.55 Dr.
9621-01-2022NEFT_IN:CMS2355644388/0028/ NEFT SAIPRIYADARSHINI PNB Txn No.S5999448Receipt6371,99,94,778.55 Dr.
9721-01-2022TO TR BAJAJ ALLIANZGENERAL INSURANCE -215410 Txn No.M103376 Branch Name - SARJAPUR ROAD,BANGALORE Cheque No. 297839Payment212401,99,95,415.55 Dr.
9821-01-2022DHC LOGISTICS PVT LTD Txn No.S2141266 Cheque No. 297835Payment100501,99,74,175.55 Dr.
9920-01-2022To:0040005500052250:SAIPRIYADARSHINI Txn No.S98751533Payment11001,99,64,125.55 Dr.
10020-01-2022BY INST 4809 : CTO386-1DAY LAT Txn No.S89723704Receipt296641,99,63,025.55 Dr.
10120-01-2022NEFT_IN:N020221800403427/0022/ THE INDOORCOLLECTION Txn No.S85418472Receipt30001,99,92,689.55 Dr.
10219-01-2022BAJAJ ALLIANZ GENERALINSURANCE CO LTD Txn No.M654161 Cheque No. 297837Payment392941,99,95,689.55 Dr.
10319-01-2022To:0040000400022033:THIRDPARTY Txn No.S71861881Payment20001,99,56,395.55 Dr.
10419-01-2022To:0040000400022033:THIRDPARTY Txn No.S71848111Payment30671,99,54,395.55 Dr.
10519-01-2022NEFT_IN:CMS2351784603/0026/ NEFT SAIPRIYADARSHINI PNB BANK Txn No.S71503430Receipt78811,99,51,328.55 Dr.
10619-01-2022To:0040005500052250:SAIPRIYADARSHINI Txn No.S71468006Payment100001,99,59,209.55 Dr.
10719-01-2022NEFT_IN:CMS2351761982/0026/ NEFT SAIPRIYADARSHINI PNB Txn No.S71440598Receipt150811,99,49,209.55 Dr.
10819-01-2022SHORTFAL REC- Inw RtrnChrgs:404448 Txn No.S65886548Payment2361,99,64,290.55 Dr.
10919-01-2022SHORTFAL REC- Inw RtrnChrgs:404458 Txn No.S65886483Payment2361,99,64,054.55 Dr.
11019-01-2022SHORTFAL REC- Inw RtrnChrgs:297833 Txn No.S65885600Payment2361,99,63,818.55 Dr.
11118-01-2022NEFT_OUT:PUNBH22018895008/P Rosy/UBIN0902802/520101073176733 Txn No.S65322173Payment80001,99,63,582.55 Dr.
11218-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S65322115Receipt5001,99,55,582.55 Dr.
11318-01-2022NEFT_OUT:PUNBH22018894955/IndigoIndustries/HDFC0000251/50200005260507 Txn No.S65322005Payment166001,99,56,082.55 Dr.
11418-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S65303152Receipt95001,99,39,482.55 Dr.
11518-01-2022CDS/CRTR/120200B1120200/1904/18-01-2022 Txn No.S64677210Receipt150001,99,48,982.55 Dr.
11618-01-2022To:0335002100027863:MAYUR TEX Txn No.S60506843Payment1000001,99,63,982.55 Dr.
11718-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S60472346Receipt980001,98,63,982.55 Dr.
11818-01-2022BY INST 961315 : CTO386-1DAY LAT Txn No.S55077092Receipt360801,99,61,982.55 Dr.
11918-01-2022IW CHQ : 297833 REJ Txn No.S52754065Payment2361,99,98,062.55 Dr.
12018-01-2022SHORTFAL REC- Inw RtrnChrgs:115904 Txn No.S49517150Payment2361,99,97,826.55 Dr.
12118-01-2022SHORTFAL REC- Inw RtrnChrgs:404480 Txn No.S49517138Payment2361,99,97,590.55 Dr.
12218-01-2022SHORTFAL REC- Inw RtrnChrgs:297834 Txn No.S49517124Payment2361,99,97,354.55 Dr.
12318-01-2022SHORTFAL REC- Inw RtrnChrgs:404447 Txn No.S49517098Payment2361,99,97,118.55 Dr.
12418-01-2022SHORTFAL REC- Inw RtrnChrgs:404479 Txn No.S49517085Payment2361,99,96,882.55 Dr.
12518-01-2022SHORTFAL REC- Inw RtrnChrgs:404403 Txn No.S49517065Payment2361,99,96,646.55 Dr.
12618-01-2022SHORTFAL REC- Inw RtrnChrgs:404446 Txn No.S49517054Payment2361,99,96,410.55 Dr.
12718-01-2022SHORTFAL REC- Inw RtrnChrgs:321801 Txn No.S49517037Payment2361,99,96,174.55 Dr.
12818-01-2022SHORTFAL REC- LedgerFolio Charges from 01-10-2021 Txn No.S49517019Payment1144.61,99,95,938.55 Dr.
12918-01-2022SHORTFAL REC- O/W RtrnChrgs: 9313 Txn No.S49517001Payment1181,99,94,793.95 Dr.
13018-01-2022SHORTFAL REC- Inw RtrnChrgs:115847 Txn No.S49516987Payment2361,99,94,675.95 Dr.
13118-01-2022SHORTFAL REC- Inw RtrnChrgs:115846 Txn No.S49516971Payment2361,99,94,439.95 Dr.
13218-01-2022SHORTFAL REC- Inw RtrnChrgs:115843 Txn No.S49516956Payment2361,99,94,203.95 Dr.
13318-01-2022SHORTFAL REC- Inw RtrnChrgs:115844 Txn No.S49516938Payment2361,99,93,967.95 Dr.
13418-01-2022SHORTFAL REC- Inw RtrnChrgs:115845 Txn No.S49516917Payment2361,99,93,731.95 Dr.
13518-01-2022D13152402CRTO004000NG00026214 Txn No.S49438594Payment292501,99,93,495.95 Dr.
13617-01-2022NEFT_OUT:PUNBH22017574509/Sumit Kumar/HDFC0000076/50100453150353 Txn No.S48970678Payment15001,99,64,245.95 Dr.
13717-01-2022To:0335002100027863:MAYUR TEX Txn No.S48942946Payment250001,99,62,745.95 Dr.
13817-01-2022NEFT_OUT:PUNBH22017574241/ShyamInnovations/KKBK0001435/0413090674 Txn No.S48942860Payment132561,99,37,745.95 Dr.
13917-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S48934634Receipt280001,99,24,489.95 Dr.
14017-01-2022NEFT_OUT:PUNBH22017574163/VrindavanCreatio/HDFC0000076/50200062038863 Txn No.S48935235Payment325341,99,52,489.95 Dr.
14117-01-2022NEFT_OUT:PUNBH22017574130/Shivanaa Homes/ICIC0000052/005205009149 Txn No.S48927778Payment225791,99,19,955.95 Dr.
14217-01-2022NEFT_OUT:PUNBH22017574102/Shivanaa Homes/ICIC0000052/005205009149 Txn No.S48928367Payment286501,98,97,376.95 Dr.
14317-01-2022CDS/CRTR/127710B1127710/2876/17-01-2022 Txn No.S48353282Receipt455001,98,68,726.95 Dr.
14417-01-2022CDS/CRTR/127710B1127710/2872/17-01-2022 Txn No.S48313360Receipt385001,99,14,226.95 Dr.
14517-01-2022To:0040000400037202:SANJEEV KUMAR Txn No.S47719590Payment48481,99,52,726.95 Dr.
14617-01-2022To:0040000400022051:THIRDPARTY Txn No.S47704379Payment60001,99,47,878.95 Dr.
14717-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S47688222Receipt130001,99,41,878.95 Dr.
14817-01-2022NEFT_IN:N017221796938992/0034/ SUPER TASTYBAKERY FOODS INDIA PVT Txn No.S44193305Receipt86401,99,54,878.95 Dr.
14917-01-2022To:0040000400022033:THIRDPARTY Txn No.S43356097Payment250001,99,63,518.95 Dr.
15017-01-2022From:0040005500052250:SAIPRIYADARSHINI Txn No.S43317822Receipt130001,99,38,518.95 Dr.
15117-01-2022BY INST 6213 : CTO386-1DAY LAT Txn No.S38761291Receipt213501,99,51,518.95 Dr.
15217-01-2022BY INST 2225 : CTO386-1DAY LAT Txn No.S38761291Receipt352001,99,72,868.95 Dr.
15317-01-2022NEFT_IN:CMS2347712228/0027/ NEFT SAIPRIYADARSHINI PNB Txn No.S38602282Receipt25332,00,08,068.95 Dr.
15414-01-2022NEFT_IN:BKIDN22014196827/0033/ THE VILLAGEHYPER MARKET Txn No.S99388905Receipt537152,00,10,601.95 Dr.
15514-01-2022UPI/201431318251/P2A/8600772299/ifsc.npciSALIM HUS Txn No.S92950893Receipt65862,00,64,316.95 Dr.
15613-01-2022NEFT_IN:CMS2341384059/0028/ NEFT SAIPRIYADARSHINI PNB BANK Txn No.S78097253Receipt3982,00,70,902.95 Dr.
15712-01-2022IMPS-IN/201215947955/9880980396/B AKBAR Txn No.S60925182Receipt9502,00,71,300.95 Dr.
15812-01-2022NEFT_IN:CMS2339567883/0027/ NEFT SAIPRIYADARSHINI PNB BANK Txn No.S59433971Receipt19602,00,72,250.95 Dr.
15912-01-2022IMPS-IN/201212156665/9449494958/CHANDRAS Txn No.S58438813Receipt22002,00,74,210.95 Dr.
16012-01-2022NEFT_IN:N012221791060836/0025/ PUNJABHANDLOOM WORLD Txn No.S58034732Receipt147302,00,76,410.95 Dr.
16111-01-2022IMPS-IN/201120510599/9894388772/Mr PRAK Txn No.S50001720Receipt97502,00,91,140.95 Dr.
16211-01-2022BY INST 703548 : CTO386-1DAY LAT Txn No.S40009419Receipt55922,01,00,890.95 Dr.
16307-01-2022REJECT:9313:FUNDSINSUFFICIENT Txn No.S78275908Payment340452,01,06,482.95 Dr.
16407-01-2022BY INST 9313 : CTO386-1DAY LAT Txn No.S75158828Receipt340452,00,72,437.95 Dr.
16506-01-2022NEFT_IN:CMS2328856703/0029/ NEFT SAIPRIYADARSHINI PNB Txn No.S57819510Receipt86392,01,06,482.95 Dr.
16604-01-2022NEFT_IN:CMS2324991576/0030/ NEFT SAIPRIYADARSHINI Txn No.S21160790Receipt25482,01,15,121.95 Dr.
16703-01-2022NEFT_IN:CMS2323377378/0034/ NEFT SAIPRIYADARSHINI PNB BANK Txn No.S6260314Receipt89362,01,17,669.95 Dr.
16803-01-2022NEFT_IN:CMS2323377990/0034/ NEFT SAIPRIYADARSHINI PNB BANK Txn No.S6213774Receipt73922,01,26,605.95 Dr.
16903-01-2022IMPS-IN/200312912441/9880980396/B AKBAR Txn No.S97073495Receipt33502,01,33,997.95 Dr.
17001-01-2022IMPS-IN/200116132954/9773902678/ramjatan Txn No.S69726393Receipt12,01,37,347.95 Dr.
171
JohnnyL



That is with the Jan 22 csv file
 
Last edited:
Upvote 0
As far as the dates are concerned, I could not find a way to correct the dates to the desired format once they were loaded into excel, thus the approach above I employed to 'scrape' the dates from the CSV file prior to loading it into Excel.
 
Upvote 0
Regarding fixing the dates.
In my
Post #75
Sub TestCSV_ExtractData()

VBA Code:
' DELETE THESE 2 LINES
    Workbooks.Open Filename:=CSV_FileToOpen
    Set csvWB = ActiveWorkbook

'REPLACE IT WITH THIS LINE - the text file date format matches your Region (Local) date format
    Set csvWB = Workbooks.Open(Filename:=CSV_FileToOpen, local:=True)

Also at the end of Sub TestCSV_ExtractData()
Call the reformatting sub.
Call CSV_ExtractData_ReformatOutput
 
Upvote 0
I could not find a way to correct the dates to the desired format
JohnnyL. But with this code, you got it all correct. columns Date, concatenated description, Voucher Type, etc., It is perfect man.
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,265
Members
449,219
Latest member
daynle

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