folks,
i need to reformat a report extracted from our ERP. the report gives me accommodation revenue by fee type for each particular room type. if printed from the ERP, the report is formatted to print each accommodation class on new page with a column for each fee type. The number of bed days and accommodation classification are above the revenue table. Below the table is another table for Previous Months Adjustments.
<tbody>
[TD="align: right"] 1 [/TD]
[TD="align: right"] 2 [/TD]
[TD="align: right"] 3 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 4 [/TD]
[TD="align: right"] 5 [/TD]
[TD="align: right"] 6 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 7 [/TD]
[TD="align: right"] 8 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 9 [/TD]
[TD="align: right"] 10 [/TD]
[TD="align: right"] 11 [/TD]
[TD="align: right"] 12 [/TD]
[TD="align: right"] 13 [/TD]
[TD="align: right"] 14 [/TD]
[TD="align: right"] 15 [/TD]
[TD="align: right"] 16 [/TD]
[TD="align: right"] 17 [/TD]
[TD="align: right"] 18 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 19 [/TD]
[TD="align: right"] 20 [/TD]
[TD="align: right"] 21 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 22 [/TD]
[TD="align: right"] 23 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 24 [/TD]
[TD="align: right"] 25 [/TD]
[TD="align: right"] 26 [/TD]
[TD="align: right"] 27 [/TD]
[TD="align: right"] 28 [/TD]
[TD="align: right"] 29 [/TD]
[TD="align: right"] 30 [/TD]
[TD="align: right"] 31 [/TD]
</tbody>
I have included row numbering to indicate the standard number of rows between each data row.
What I want to do is to separate the fee amounts into columns and to use the Classification, month and number of bed days as columns themselves. Below is the end result i want to create.
<tbody>
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]
<tbody>
</tbody>
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
The text to columns part is easy:
its the moving of Classification, Month and Bed days that is vexing me.
<!-- Table easily created from Excel with ASAP Utilities (https://www.asap-utilities.com) -->
i need to reformat a report extracted from our ERP. the report gives me accommodation revenue by fee type for each particular room type. if printed from the ERP, the report is formatted to print each accommodation class on new page with a column for each fee type. The number of bed days and accommodation classification are above the revenue table. Below the table is another table for Previous Months Adjustments.
Classification : ABC PATIENT FUND TOTALS |
------- ---- ------ |
Current Month : Accom. Profess. Other Accom. Profess. Other Totals |
Fees Fees |
Bed Days : 456 |
Amount Raised 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Pre-Admission Deposits 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Receipts 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Pre-Admission Refunds 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Refunds 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
JNL:MONTH/S PRIOR ADJUSTMENT 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
---------- ---------- ---------- ---------- ---------- ---------- ----------- |
0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
================================================================================================================================== |
Previous Months Adjustments: Accom. Profess. Other Accom. Profess. Other Totals |
Fees Fees |
Bed Days : 108 |
Amount Raised 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Pre-Admission Deposits 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Receipts 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Pre-Admission Refunds 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Refunds 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
---------- ---------- ---------- ---------- ---------- ---------- ----------- |
0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
================================================================================================================================== |
<tbody>
[TD="align: right"] 1 [/TD]
[TD="align: right"] 2 [/TD]
[TD="align: right"] 3 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 4 [/TD]
[TD="align: right"] 5 [/TD]
[TD="align: right"] 6 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 7 [/TD]
[TD="align: right"] 8 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 9 [/TD]
[TD="align: right"] 10 [/TD]
[TD="align: right"] 11 [/TD]
[TD="align: right"] 12 [/TD]
[TD="align: right"] 13 [/TD]
[TD="align: right"] 14 [/TD]
[TD="align: right"] 15 [/TD]
[TD="align: right"] 16 [/TD]
[TD="align: right"] 17 [/TD]
[TD="align: right"] 18 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 19 [/TD]
[TD="align: right"] 20 [/TD]
[TD="align: right"] 21 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 22 [/TD]
[TD="align: right"] 23 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 24 [/TD]
[TD="align: right"] 25 [/TD]
[TD="align: right"] 26 [/TD]
[TD="align: right"] 27 [/TD]
[TD="align: right"] 28 [/TD]
[TD="align: right"] 29 [/TD]
[TD="align: right"] 30 [/TD]
[TD="align: right"] 31 [/TD]
</tbody>
I have included row numbering to indicate the standard number of rows between each data row.
What I want to do is to separate the fee amounts into columns and to use the Classification, month and number of bed days as columns themselves. Below is the end result i want to create.
Classification | Month | Bed Days | Current Month : | Accom. | Profess. | Other | Accom. | Profess. | Other | Totals |
Fees | Fees | |||||||||
ABC | Current Month : | Amount Raised | ||||||||
ABC | Current Month : | Pre-Admission Deposits | ||||||||
ABC | Current Month : | Receipts | ||||||||
ABC | Current Month : | Pre-Admission Refunds | ||||||||
ABC | Current Month : | Refunds | ||||||||
ABC | Previous Months Adjustments: | Amount Raised | ||||||||
ABC | Previous Months Adjustments: | Pre-Admission Deposits | ||||||||
ABC | Previous Months Adjustments: | Receipts | ||||||||
ABC | Previous Months Adjustments: | Pre-Admission Refunds | ||||||||
ABC | Previous Months Adjustments: | Refunds | ||||||||
================================= | ============== | ============== | ============== | ============== | ============== | ============== | ============= |
<tbody>
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]
<tbody>
</tbody>
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 456 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"] 0 [/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
The text to columns part is easy:
Code:
Dim sFileName As String 'Show the open dialog and pass the selected file name to the String variable "sFileName"
sFileName = Application.GetOpenFilename
'They have cancelled.
If sFileName = "False" Then Exit Sub
Workbooks.OpenText Filename:=sFileName, Origin:=xlMSDOS, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 1), Array(33, 1), Array(47, 1), Array(61, 1), Array(64, 1), Array(75, 1), Array(89 _
, 1), Array(103, 1), Array(117, 1)), TrailingMinusNumbers:=True
its the moving of Classification, Month and Bed days that is vexing me.
<!-- Table easily created from Excel with ASAP Utilities (https://www.asap-utilities.com) -->
Last edited: