hassanleo1987
Board Regular
- Joined
- Apr 19, 2017
- Messages
- 56
Hi!
I would like to request the help of VBA experts on a tedious & time consuming problem I have facing.
Currently I have a daily data summary in a compressed / summarized format that I need to expand vertically which later will be incorporated in a database of future analysis and forecasting.
The current data structure is as following:
The Column B has the max value of Item A for next 6 instances i.e., max value from Column AAA to FFF is 6
The desired Data structure should expand vertically where A is repeated in consective rows until max value of rows are filled. (6 rows with A).
Next Column AAA to FFF are filled with a repeated value, lets say 1 as per each column's respective number is current data set. AAA=5, BBB=1 and so on for Data_N = A.
Same senario is implemented on each distinct value in Data_N. Resultant Data Struture should be as following:
The solution can be single or multiple sheet.
Kindly look into this problem and advice of a solution with VBA.
Thanks!
I would like to request the help of VBA experts on a tedious & time consuming problem I have facing.
Currently I have a daily data summary in a compressed / summarized format that I need to expand vertically which later will be incorporated in a database of future analysis and forecasting.
The current data structure is as following:
Sample.xlsx | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
3 | Data_N | Max.Val | AAA | BBB | CCC | DDD | EEE | FFF | ||
4 | A | 6 | 5 | 1 | 6 | 3 | 0 | 1 | ||
5 | B | 8 | 6 | 2 | 5 | 8 | 5 | 2 | ||
6 | C | 6 | 2 | 3 | 4 | 2 | 6 | 1 | ||
7 | D | 5 | 3 | 4 | 3 | 1 | 0 | 5 | ||
8 | E | 6 | 0 | 5 | 2 | 4 | 3 | 6 | ||
9 | F | 8 | 1 | 6 | 1 | 5 | 5 | 8 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B4:B9 | B4 | =MAX(C4:H4) |
The Column B has the max value of Item A for next 6 instances i.e., max value from Column AAA to FFF is 6
The desired Data structure should expand vertically where A is repeated in consective rows until max value of rows are filled. (6 rows with A).
Next Column AAA to FFF are filled with a repeated value, lets say 1 as per each column's respective number is current data set. AAA=5, BBB=1 and so on for Data_N = A.
Same senario is implemented on each distinct value in Data_N. Resultant Data Struture should be as following:
Required Expanded Data Model | ||||||
Data_N | AAA | BBB | CCC | DDD | EEE | FFF |
A | 1 | 1 | 1 | 1 | 1 | |
A | 1 | 1 | 1 | |||
A | 1 | 1 | 1 | |||
A | 1 | 1 | ||||
A | 1 | 1 | ||||
A | 1 | |||||
B | 1 | 1 | 1 | 1 | 1 | 1 |
B | 1 | 1 | 1 | 1 | 1 | 1 |
B | 1 | 1 | 1 | 1 | ||
B | 1 | 1 | 1 | 1 | ||
B | 1 | 1 | 1 | 1 | ||
B | 1 | 1 | ||||
B | 1 | |||||
B | 1 | |||||
C | 1 | 1 | 1 | 1 | 1 | 1 |
C | 1 | 1 | 1 | 1 | 1 | |
C | 1 | 1 | 1 | |||
C | 1 | 1 | ||||
C | 1 | |||||
C | 1 | |||||
D | 1 | 1 | 1 | 1 | 1 | |
D | 1 | 1 | 1 | 1 | ||
D | 1 | 1 | 1 | 1 | ||
D | 1 | 1 | ||||
D | 1 | |||||
E | 1 | 1 | 1 | 1 | 1 | |
E | 1 | 1 | 1 | 1 | 1 | |
E | 1 | 1 | 1 | 1 | ||
E | 1 | 1 | 1 | |||
E | 1 | 1 | ||||
E | 1 | |||||
F | 1 | 1 | 1 | 1 | 1 | 1 |
F | 1 | 1 | 1 | 1 | ||
F | 1 | 1 | 1 | 1 | ||
F | 1 | 1 | 1 | 1 | ||
F | 1 | 1 | 1 | 1 | ||
F | 1 | 1 | ||||
F | 1 | |||||
F | 1 | |||||
The solution can be single or multiple sheet.
Kindly look into this problem and advice of a solution with VBA.
Thanks!