Jemma Atkinson
Well-known Member
- Joined
- Jul 7, 2008
- Messages
- 509
Hi, i am after a VBA code that will produce result as shown in sheet After. I do not want the code to create sheet"After". The sheet is already established.
I need the code to apply the following rules.
1. If the Security code is the same as shown in row 21 and 22 in Sheet("After") then subtotal the unit holding.
2. If Security is different but the the first word in the description is the same then group the descriptions together but do not add subtotal to unit holdings, so we can see this by example of Cogent, Gala, Gas.
Else leave security and description on single row as shown by ZZZZZ.
3. I need the code to do Statement - Unitholding calc, but if there is a subtotal then do Statement -Subtotal as shown in F23
I would prefer the After sheet to be in A-Z order by description
I need the code to apply the following rules.
1. If the Security code is the same as shown in row 21 and 22 in Sheet("After") then subtotal the unit holding.
2. If Security is different but the the first word in the description is the same then group the descriptions together but do not add subtotal to unit holdings, so we can see this by example of Cogent, Gala, Gas.
Else leave security and description on single row as shown by ZZZZZ.
3. I need the code to do Statement - Unitholding calc, but if there is a subtotal then do Statement -Subtotal as shown in F23
I would prefer the After sheet to be in A-Z order by description
Excel Workbook | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
5 | Security | Pfolio | Code Long Name | Location | Stock Exchange | Maturity Date | Unit Holding | ||
6 | ABPORT | WTEHYF | ADMIRAL ACQUISTIONS UK | PHX | GB0 | 14-Aug-14 | 32,666,666.00 | ||
7 | ACI1113 | WSTAHY | NORWAY CORRECTIONAL INVESTMENT 161113 FRN | PHY | AU0 | 7-Apr-17 | 6,582,658.00 | ||
8 | ACI1113 | WSTBFA | NORWAY CORRECTIONAL INVESTMENT 161113 FRN | PHY | AU0 | 7-Apr-17 | 4,076,845.00 | ||
9 | COGCFAC | PISFUL | COGENT CREDIT FACILITY 311011 FULCRUM MEDIA FINANCE 2 PTY LT | PHX | OTC | 31-Oct-11 | 1,884,983.83 | ||
10 | COGCFAC1 | PISFUL | COGENT CREDIT FACILITY 3112 FULCRUM MEDIA FINANCE 2 PTY LT 1 | PHX | OTC | 31-Dec-20 | - 20,000,000.00 | ||
11 | GALAB | WTEHYF | GALA ELECTRIC CASINOS | PHX | GB0 | 28-Oct-13 | 3,327,464.79 | ||
12 | GALAB1 | WTEHYF | GALA ELECTIC CASINOS 1 | PHX | GB0 | 28-Oct-13 | 3,339,435.30 | ||
13 | GALAB2 | WTEHYF | GALA ELECTRIC CASINOS | PHX | GB0 | 28-Oct-13 | 2,912,369.98 | ||
14 | GALAC | WTEHYF | GALA ELECTRIC CASINOS | PHX | GB0 | 27-Oct-14 | 3,295,836.24 | ||
15 | GALAC1 | WTEHYF | GALA ELECTIRC CASINOS 1 | PHX | GB0 | 27-Oct-14 | 3,415,379.12 | ||
16 | GALAC2 | WTEHYF | GALA ELECTRIC CASINOS | PHX | GB0 | 27-Oct-14 | 2,868,711.47 | ||
17 | GFC0414 | 1ANXXE | GAS AND FUEL CORPORATION OF VICTORIA 010414 8.90 CB | PHY | AU0 | 1-Apr-14 | 1,000,000.00 | ||
18 | GFC0916 | 1ANXXE | GAS AND FUEL CORPORATION OF VICTORIA 010916 CB | PHY | AU0 | 1-Sep-16 | 1,000,000.00 | ||
19 | ZZZZZZZ | TESTING | JOE BLOGGS | PHY | USD | 1-Apr-14 | 242,344.36 | ||
20 | |||||||||
21 | |||||||||
22 | |||||||||
Before |
Excel Workbook | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
5 | Security | Pfolio | Description | Unit Holding | Statement | Difference | ||
6 | COGCFAC | PISFUL | COGENT CREDIT FACILITY 311011 FULCRUM MEDIA FINANCE 2 PTY LT | 1,884,983.83 | - 1,884,983.83 | |||
7 | COGCFAC1 | PISFUL | COGENT CREDIT FACILITY 3112 FULCRUM MEDIA FINANCE 2 PTY LT 1 | - 20,000,000.00 | 20,000,000.00 | |||
8 | ||||||||
9 | GALAB | WTEHYF | GALA ELECTRIC CASINOS | 3,327,464.79 | - 3,327,464.79 | |||
10 | GALAB1 | WTEHYF | GALA ELECTIC CASINOS 1 | 3,339,435.30 | - 3,339,435.30 | |||
11 | GALAB2 | WTEHYF | GALA ELECTRIC CASINOS | 2,912,369.98 | - 2,912,369.98 | |||
12 | GALAC | WTEHYF | GALA ELECTRIC CASINOS | 3,295,836.24 | - 3,295,836.24 | |||
13 | GALAC1 | WTEHYF | GALA ELECTIRC CASINOS 1 | 3,415,379.12 | - 3,415,379.12 | |||
14 | GALAC2 | WTEHYF | GALA ELECTRIC CASINOS | 2,868,711.47 | - 2,868,711.47 | |||
15 | ||||||||
16 | GFC0414 | 1ANXXE | GAS AND FUEL CORPORATION OF VICTORIA 010414 8.90 CB | 1,000,000.00 | - 1,000,000.00 | |||
17 | GFC0916 | 1ANXXE | GAS AND FUEL CORPORATION OF VICTORIA 010916 CB | 1,000,000.00 | - 1,000,000.00 | |||
18 | ||||||||
19 | ZZZZZZZ | TESTING | JOE BLOGGS | 242,344.36 | - 242,344.36 | |||
20 | ||||||||
21 | ACI1113 | WSTAHY | AUSTRALIAN CORRECTIONAL INVESTMENT 161113 FRN | 6,582,658.00 | ||||
22 | ACI1113 | WSTBFA | AUSTRALIAN CORRECTIONAL INVESTMENT 161113 FRN | 4,076,845.00 | ||||
23 | 10,659,503.00 | - 10,659,503.00 | ||||||
24 | ||||||||
25 | ||||||||
After |