Possible to rearrange really broken Trial Balance sheets?

Fabulist

Board Regular
Joined
Jan 28, 2014
Messages
110
Hello everyone!

I am using a software suite which produces Trial Balances in a completely problematic and difficult to edit form. It looks like this (partial example, incorrect totals):

View image: TB

Usually, and ideally, a software generated Trial Balance would look like this:

AccountDescriptionRecordRecord Balance2014 Y/ECurrent BalanceThis PeriodYear to DateCurrent Balance
--DebitCreditDebitCreditDebitCreditDebitCreditDebitCreditDebitCreditDebitCredit
12-01-00-0002Floor-Separators565,77565,77565,77565,77
12-01-00-0003Door-Separators1.584,301.000,001.584,30600,001.584,301.584,30
12-01-00-0004Lead1.454,441.454,441.454,441.454,44
12-01-00-0005334,69334,69334,69334,69
12-01-00-0006Hydralic Installations557,53557,53200,00200,00150,00150,0075,0075,00557,53557,53
12-01-00-0007Crystals692,59692,59692,59692,59
12-01-00-0008WEST POINT704,33704,33704,33704,33
12-01-00-0009Air-condition621,761.000,00621,76700,00621,76621,76
12-01-00-0010Air-condition484,97484,97484,97484,97
12-01-00-0011Monitor R1407.404,187.404,187.404,185.500,007.404,181.999,00
12-06Other mechanical equipment2.169,562.169,562.169,562.169,56
12-06-00Other mechanical equipment2.169,562.169,562.169,562.169,56
12-06-00-0000Air-condition909,78909,78909,78909,78

<tbody>
</tbody>

The fact that the cells are separated the way they are makes it incredibly difficult to use the data, a situation enhanced by titles that are on top of each other instead of side to side. In case you have not seen a TB before, the table in the example is separated by the company's name (software - specific) and goes on for many accounts.

Would it be possible that this mess is somehow fixed and rearranged to the ideal format automatically, or at least eliminate the problematic cells / columns so editing and summing is not a frustrating situation with doubtful results?

I have uploaded the file here, since copy pasting it in the forum did not produce the same results: Example in case anyone wants to take a direct look.

Thank you to anyone who replies in advance!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I think I became blind for a second there, I did not even notice the fact some lines appear as doubles, I actually though they were completely missing. So it seems it does work and it is accurate, the only problem is that it separates accounts and duplicates them in order to make a proper separation.

I cannot thank you enough for this, this is very helpful, I will attempt to learn from the macro you created!
 
Upvote 0
I think I became blind for a second there, I did not even notice the fact some lines appear as doubles, I actually though they were completely missing. So it seems it does work and it is accurate, the only problem is that it separates accounts and duplicates them in order to make a proper separation.

I cannot thank you enough for this, this is very helpful, I will attempt to learn from the macro you created!
Can you post a copy of the spreadsheet that results when you first get your data so we can see what the software suite produces originally? That way we don't have to try and type it from the picture that you posted in order to test code against it.
 
Upvote 0
Can you post a copy of the spreadsheet that results when you first get your data so we can see what the software suite produces originally? That way we don't have to try and type it from the picture that you posted in order to test code against it.

It is on post #11, at the "Link: Example", it contains a sample of the problematic area. This area you will see is repeated over and over for hundreds of times, and while separated from each other, titles come into place again and again, like the company's name and address. The latter is not included in the example, but it is a similar line like the "General Trial Balance" one, which is also repeated.
 
Upvote 0
It is on post #11, at the "Link: Example"
I saw that, but the worksheet you show there looks nothing like the picture of the output from the software suite you showed in the link you provided in Message #1... I wanted to see the worksheet that resulted when you loaded the output from the software suite in its raw form (that is, before any macro code touches it).
 
Upvote 0
The raw form looks very similar to what I have in the "Example.xlsx", it just get repeated over and over. As for the link in message one, it is a direct picture from the "Example" xls file, nothing is changed. If you are talking about "how it should look" or "standard look" it also looks the same to me with what I have in the "Example.xlsx".

Note that "Example.xlsx" containts two sheets, "Hell on Earth" and "Standard", which are the software's raw output and an example of how it should look from me, respectively.
 
Upvote 0
the only problem is that it separates accounts and duplicates them in order to make a proper separation.

Try this one:

Code:
Sub formattba2c()
Dim x%, y As Variant, lr%
y = Array(1, 4, 11, 12, 15, 16, 20, 21, 25, 26, 29, 30, 36, 37, 40)
With ActiveSheet.UsedRange
.Value = .Value
.UnMerge
Columns(30).Copy
Columns(29).PasteSpecial SkipBlanks:=True
Columns(30).ClearContents
Range("a16").Resize(.Rows.Count - 17, 4).Cut Destination:=Range("a14")
With Range("a14").Resize(.Rows.Count - 19, 4)
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
.Value = .Value
Range("a14").Copy
.PasteSpecial Paste:=xlPasteFormats
End With
For x = 42 To 1 Step -1
If IsNumeric(Application.Match(x, y, 0)) = False Then
Columns(x).Delete
End If
Next
lr = Cells(Rows.Count, 1).End(xlUp).Row
For x = lr - 1 To 14 Step -1
If Cells(x, 1) = Cells(x - 1, 1) And Application.CountA(Cells(x, 3).Resize(, 13)) <> 0 Then
Cells(x, 3).Resize(, 13).Copy
Cells(x - 4, 4).PasteSpecial SkipBlanks:=True
Rows(x).Delete
Else
End If
If Application.CountA(Cells(x, 3).Resize(, 13)) = 0 Then
Rows(x).Delete
End If
Next
.Columns.AutoFit
.Rows.AutoFit
End With
End Sub
 
Upvote 0
sheetspread I very much appreciate your effort, this a semi-translated duplicate of the original file, with the full data: TRIAL BALANCE 30-09-2015

Your macro works perfectly on the "Example" file, but for some reason it does not function well on a full scale. The first thing I noticed is that the codes on the left appear erroneously; e.g. code "12" does not appear at all and its values are not aligned. "12-00" appears as "36861" and other values below are misaligned or misplaced, while others appear correctly.

I have translated everything beside the descriptions, which should not be a problem. Unfortunately, I lack the skills to both edit and understand your macro, so I cannot correct this myself, excuse me for this.

Thanks again.

PS: I will keep all links alive for future reference, in case someone else encounters a similar problem in the future - in case they are offline and someone is looking for the original files, please contact me.
 
Upvote 0
The raw form looks very similar to what I have in the "Example.xlsx", it just get repeated over and over. As for the link in message one, it is a direct picture from the "Example" xls file, nothing is changed.
:confused: Nothing is changed? I'm confused. The link in Message #1 shows the Account Numbers in a set of merged cells, the Description in another set of merged cells, the Debit and Credit values in the Record, Record Balance and Year columns are stacked one on top of the other with the Debit in a single cell and the Credit in a merged cell under it... and those are just what I see off the top of my head... with the exception of the header row, your example file shows all the data neatly in their own non-merged rows and columns. So, they sure look a lot different to me, hence, my confusion. In order to transform one into the other, I need a copy of the worksheet containing the original data as it first appears when brought into Excel in, as you described it in Message #1, the "completely problematic and difficult to edit form".
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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