Code to Customize Bank statement

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello Experts

I have this code which customizes bank statement as I want it to be. This code works for one particular bank only. AS there are N number of banks and the format and heading of each bank is different, I am not able to edit the code accordingly. AS the code was shared without comments, I don’t have any idea what some of the lines in the code actually do. The code in the VBA editor window works for the bank hidden in the workbook only. There is another code which is to be included in this bank code which combines text of multiple rows at each change in date. I need your expertise to edit both the codes wherever required and get the result as shown in the expected result sheet. I request you to please add a comment at line of code so that I can create multiple apps depending on each bank.
The sheet Bank is the original form as and when the data is received. I need the code for this sheet and get the result as in sheet Expected Result.
P.S: The code in the visual basic is only for reference purpose as it will help to solve more than 50% of the work. To test the code Bank Clean Data in the workbook you have to unhide the bank and name it as Bank.Customize New Bank.xlsm
 
Change that sname line to whatever you want to call the new sheet.
Ex:
sname = "NameOfNewSheet"

Your commenting out of lines has altered the values that use to work for that line.
Did you miss that post?
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Oops... I missed that. Now the code has run 5 more lines, created the bank data sheet and some of the data.
 
Upvote 0
I got all the headers all wrong and not in the expected order. No date column, 2 narrations columns, cheq.Ref No. column which was not needed.....😪
 
Upvote 0
Headers in wrong order? Are you sure the data is not in the wrong order? It is kind of difficult to mess up the order of the headers.
 
Upvote 0
ROFL.
hAHAHA.png
 
Upvote 0
The following is the original Header array:
VBA Code:
    hdr = Array("Line", "Txn Date", "Month", "Voucher Type", "Dr Amount", _
            "Cr Amount", "Balance", "Check", "Narration")                       ' Array of headers to write to the created sheet

And the following is the line that prints it to the new sheet:
VBA Code:
        .[A1].Resize(, 9) = hdr                                                 '   Write the array of headers to first row of new sheet

Like I said, kind of hard to mess it up.

What do you have for hdr line of code now?
 
Upvote 0
I missed to write the "date".😉
Give me some time. By tomorrow I will finish if possible to get at least the headings and data in the rows right.
 
Upvote 0
Another Tip ... When you are commenting out a line, put the ' at the beginning of the line, not right next to words in the line that you are commenting out. It makes it easier to spot the lines that are commented out if you have the apostrophe at the beginning of the line.
 
Upvote 0
Can you please tell me these lines which is what

For i = 2 To UBound(ar, 1) ' which data is it referring to Bank or new sheet.
What does n stand for exactly n = i - 1
Then again arr(n, 1) = n,,,,??
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,277
Members
449,093
Latest member
Vincent Khandagale

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