mehidy1437
Active Member
- Joined
- Nov 15, 2019
- Messages
- 348
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
- Mobile
- Web
Hi There,
I have data in Sheet1 as below.
If the cell value is greater than 40, then I want to divide the cell by 40, put balance value beneath(if there is any balance), also I want to put the number of division done in column T.
How can I do this in Excel VBA?
My desire output in Sheet2 as below.
Sheet1
Sheet2
I have data in Sheet1 as below.
If the cell value is greater than 40, then I want to divide the cell by 40, put balance value beneath(if there is any balance), also I want to put the number of division done in column T.
How can I do this in Excel VBA?
My desire output in Sheet2 as below.
Sheet1
2233.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
H | I | J | K | L | M | N | |||
3 | STYLE | COLOR | ORD NO | S | M | L | XL | ||
4 | MHT01 | WHITE | 111 | 100 | 300 | 100 | 100 | ||
5 | MHT01 | RED | 111 | 100 | 5 | 130 | 5 | ||
6 | MHT01 | BLUE | 112 | 120 | 1 | 1 | 1 | ||
7 | MHT01 | BLACK | 112 | 1 | 1 | 1 | 130 | ||
Sheet1 |
Sheet2
2233.xlsm | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | |||
3 | STYLE | COLOR | ORD NO | S | M | L | XL | QTY/CTN | CTN | TTL | |||||||||
4 | MHT01 | WHITE | 111 | 40 | 40 | 2 | 80 | ||||||||||||
5 | MHT01 | WHITE | 111 | 20 | 20 | 1 | 20 | ||||||||||||
6 | MHT01 | WHITE | 111 | 40 | 40 | 7 | 280 | ||||||||||||
7 | MHT01 | WHITE | 111 | 20 | 20 | 1 | 20 | ||||||||||||
8 | MHT01 | WHITE | 111 | 40 | 40 | 2 | 80 | ||||||||||||
9 | MHT01 | WHITE | 111 | 20 | 20 | 1 | 20 | ||||||||||||
10 | MHT01 | WHITE | 111 | 40 | 40 | 2 | 80 | ||||||||||||
11 | MHT01 | WHITE | 111 | 20 | 20 | 1 | 20 | ||||||||||||
12 | MHT01 | RED | 111 | 40 | 40 | 2 | 80 | ||||||||||||
13 | MHT01 | RED | 111 | 20 | 20 | 1 | 20 | ||||||||||||
14 | MHT01 | RED | 111 | 40 | 40 | 3 | 120 | ||||||||||||
15 | MHT01 | RED | 111 | 10 | 10 | 1 | 10 | ||||||||||||
16 | MHT01 | RED | 111 | 5 | 5 | 10 | 1 | 10 | |||||||||||
17 | MHT01 | BLUE | 112 | 40 | 40 | 3 | 120 | ||||||||||||
18 | MHT01 | BLUE | 112 | 1 | 1 | 1 | 3 | 1 | 3 | ||||||||||
19 | MHT01 | BLACK | 112 | 40 | 40 | 3 | 120 | ||||||||||||
20 | MHT01 | BLACK | 112 | 10 | 10 | 1 | 10 | ||||||||||||
21 | MHT01 | BLACK | 112 | 1 | 1 | 1 | 3 | 1 | 3 | ||||||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
S4:S21 | S4 | =SUM(H4:K4) |
U4:U21 | U4 | =SUM(H4:K4)*T4 |