PureBluff
Board Regular
- Joined
- Apr 4, 2014
- Messages
- 174
- Office Version
- 2016
- Platform
- Windows
- Mobile
Trying to simplify some monotonous work for my wife, who looks after a lot of company accounts, these are ever changing. Due to it being financial information, I am not in a position to upload the workbook.
I have written code to look at a range of Company abbreviations, find them in a column & return the column number. She will maintain a configuration worksheet with this list (the easiest end user method I could think of for self maintenance as new companies are opened & added. Happy to hear improvements as I often use this approach to make it more user friendly
The Company abbreviations are the sheetnames in a second workbook.
I am now working on the rows, which again, can be altered in the future (inserts, different data on different rows on each sheet), each row has to have a nominal code, except totals, which I can ignore, so Col.B is the ideal list to work/loop through
As you will see the nominal codes have some single values, ranges, multi-value as well values & ranges together.
The codes are fixed to the description but new codes could be added in the future (I could update it for her each time, or use spare cells on the configuration page, to reference)
The end result is to perform an aggregation from another workbook - the sheetname is the Company abbreviation and each record in the below has a nominal code, which will allow me to construct a fomula, if I knew how to tackle the varying nominal codes
Could someone kindly give me a steer with this? I hope I have explained it well enough.
Many thanks
I have written code to look at a range of Company abbreviations, find them in a column & return the column number. She will maintain a configuration worksheet with this list (the easiest end user method I could think of for self maintenance as new companies are opened & added. Happy to hear improvements as I often use this approach to make it more user friendly
VBA Code:
[/B]
With Sheets("Config")
CfgLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
For r = 2 To CfgLastRow
Comp = ThisWorkbook.Sheets(Cfg).Range("A" & r).Value
Set cell = Cells.Find(Comp, , xlValues, xlWhole, , , False)
If Not cell Is Nothing Then
c = Split(cell.Address, "$")(1)]
The Company abbreviations are the sheetnames in a second workbook.
I am now working on the rows, which again, can be altered in the future (inserts, different data on different rows on each sheet), each row has to have a nominal code, except totals, which I can ignore, so Col.B is the ideal list to work/loop through
As you will see the nominal codes have some single values, ranges, multi-value as well values & ranges together.
The codes are fixed to the description but new codes could be added in the future (I could update it for her each time, or use spare cells on the configuration page, to reference)
Workbook.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | |||
1 | Company1 | Company1 | Company2 | Company2 | BLL | ||||
2 | Actual | Forecast | Actual | Forecast | Actual | ||||
3 | 4000 - 4099 | Sales Income (External) | |||||||
4 | 4100 | Sales Income (Internal) | |||||||
5 | 4101 - 4999 | Other Income | |||||||
6 | Total | £0.00 | £0.00 | £0.00 | £0.00 | £0.00 | |||
7 | 5000 - 6999 | Purchases | |||||||
8 | 2220 | Direct Labour | |||||||
9 | 2210, 2230 | Employer's Cost | |||||||
10 | 7100, 7103 | Rent and Rates | |||||||
11 | 7102, 7200 - 7299 | Heat, Light and Water | |||||||
12 | 7300 - 7350 | Motor Expenses | |||||||
13 | 7400 - 7499 | Travelling | |||||||
14 | 7500 - 7503 | Printing and Stationery | |||||||
15 | 7550 - 7560 | Telephone and Computer Charges | |||||||
16 | 6201, 7601 - 7606 | Professional Fees/Advertising | |||||||
17 | 7700 - 7799 | Equipment Hire and Rental | |||||||
18 | 7800 - 7899 | Maintenance & Premises Expenses | |||||||
19 | 8201 | Insurance | |||||||
May23 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D6:H6 | D6 | =SUM(D3:D5) |
The end result is to perform an aggregation from another workbook - the sheetname is the Company abbreviation and each record in the below has a nominal code, which will allow me to construct a fomula, if I knew how to tackle the varying nominal codes
Mintridge Cashbook.xlsx | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Company1 | |||||
2 | Date | Description | NC Purchase Inv | Tax Point Date | ||
58 | 30/05/2023 | Amazon | 7602 | 01/05/2023 | ||
59 | 31/05/2023 | eBay | 5006 | 24/03/2023 | ||
60 | 31/05/2023 | MrExcel Gift Shop | 5006 | 24/04/2023 | ||
CRL |
Could someone kindly give me a steer with this? I hope I have explained it well enough.
Many thanks