abdo meghari
Well-known Member
- Joined
- Aug 3, 2021
- Messages
- 606
- Office Version
- 2019
Hi
I would insert BALANCE column after QTY column E and multiply PRICE * QTY
exclude the headers from multiply PRICE * QTY.
what I want
this is what I try to do that
no need show formulas, don't repeat insert column when every time run the macro and show numbers as formatting when insert column .
I have two sheet to implement that.
than
I would insert BALANCE column after QTY column E and multiply PRICE * QTY
exclude the headers from multiply PRICE * QTY.
KashfMabiatReportALMUFAWADIEA.xls | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
2 | 2,000.000 | 2024.04.28 | 835 | 500.000 | 4 | 1483 | KM 235/55R17 HS52 KOR | ||
3 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
4 | 4,310.000 | 2024.05.21 | 954 | 465.000 | 4 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
5 | 490.000 | 5 | 1300 | XPRO 70A L KOR | |||||
6 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
7 | 1,020.000 | 2024.05.21 | 957 | 510.000 | 2 | 1538 | DONGA 70A L KOR | ||
8 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
9 | 3,000.000 | 2024.06.04 | 1002 | 750.000 | 4 | 1346 | BS 255/70R15C D840 | ||
10 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
11 | 345.000 | 2024.06.10 | 1020 | 345.000 | 1 | 1550 | VIPIEMME 45A L IT | ||
12 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
13 | 12,200.000 | 2024.06.13 | 1029 | 550.000 | 4 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
14 | 2,500.000 | 4 | 1554 | TOP TRUST 16.9-30 12PR R-1 TR218 TT CHI | |||||
15 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
16 | 2,265.000 | 2024.07.09 | 1097 | 485.000 | 4 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
17 | 325.000 | 1 | 1573 | DONGAH TUBE 16.9-3 TR218A VIT | |||||
18 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
19 | 2,050.000 | 2024.07.10 | 1103 | 1,025.000 | 2 | 1568 | MOTORMECH 150A L KOR | ||
20 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
21 | 4,270.000 | 2024.07.30 | 970000020 | 425.000 | 4 | 1343 | KM 215/65R16 TA21 KOR | ||
22 | 1,285.000 | 2 | 1495 | XPRO 200A L KOR | |||||
23 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
24 | 390.000 | 2024.08.05 | 970000043 | 390.000 | 1 | 1337 | XPRO 55A L KOR | ||
25 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
26 | 390.000 | 2024.08.11 | 970000077 | 390.000 | 1 | 1337 | XPRO 55A L KOR | ||
27 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | ||
28 | 4,200.000 | 2024.08.19 | 970000142 | 2,100.000 | 2 | 1285 | GC 1200R20 AZ0183 CHI | ||
Page 0 |
what I want
KashfMabiatReportALMUFAWADIEA.xls | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | TOTAL | DATE | INVOICE NO | PRICE | QTY | BALANCE | CODE | BRAND | ||
2 | 2,000.000 | 2024.04.28 | 835 | 500.000 | 4 | 2,000.00 | 1483 | KM 235/55R17 HS52 KOR | ||
3 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
4 | 4,310.000 | 2024.05.21 | 954 | 465.000 | 4 | 1,860.00 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
5 | 490.000 | 5 | 2,450.00 | 1300 | XPRO 70A L KOR | |||||
6 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
7 | 1,020.000 | 2024.05.21 | 957 | 510.000 | 2 | 1,020.00 | 1538 | DONGA 70A L KOR | ||
8 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
9 | 3,000.000 | 2024.06.04 | 1002 | 750.000 | 4 | 3,000.00 | 1346 | BS 255/70R15C D840 | ||
10 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
11 | 345.000 | 2024.06.10 | 1020 | 345.000 | 1 | 345.00 | 1550 | VIPIEMME 45A L IT | ||
12 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
13 | 12,200.000 | 2024.06.13 | 1029 | 550.000 | 4 | 2,200.00 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
14 | 2,500.000 | 4 | 10,000.00 | 1554 | TOP TRUST 16.9-30 12PR R-1 TR218 TT CHI | |||||
15 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
16 | 2,265.000 | 2024.07.09 | 1097 | 485.000 | 4 | 1,940.00 | 1535 | TOP TRUST 7.5-16-8PR F2-1 TT CHINA | ||
17 | 325.000 | 1 | 325.00 | 1573 | DONGAH TUBE 16.9-3 TR218A VIT | |||||
18 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
19 | 2,050.000 | 2024.07.10 | 1103 | 1,025.000 | 2 | 2,050.00 | 1568 | MOTORMECH 150A L KOR | ||
20 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
21 | 4,270.000 | 2024.07.30 | 970000020 | 425.000 | 4 | 1,700.00 | 1343 | KM 215/65R16 TA21 KOR | ||
22 | 1,285.000 | 2 | 2,570.00 | 1495 | XPRO 200A L KOR | |||||
23 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
24 | 390.000 | 2024.08.05 | 970000043 | 390.000 | 1 | 390.00 | 1337 | XPRO 55A L KOR | ||
25 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
26 | 390.000 | 2024.08.11 | 970000077 | 390.000 | 1 | 390.00 | 1337 | XPRO 55A L KOR | ||
27 | TOTAL | DATE | INVOICE NO | PRICE | QTY | CODE | BRAND | |||
28 | 4,200.000 | 2024.08.19 | 970000142 | 2,100.000 | 2 | 4,200.00 | 1285 | GC 1200R20 AZ0183 CHI | ||
Page 0 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2,F28,F26,F24,F21:F22,F19,F16:F17,F13:F14,F11,F9,F7,F4:F5 | F2 | =D2*E2 |
this is what I try to do that
VBA Code:
Sub inst()
Dim ws As Worksheet
Dim i As Long
For i = 1 To 2
Sheets(i).Range("F:F").EntireColumn.Insert
Sheets(i).Range("F:F") = "BALANCE"
Sheets(i).Range("F:F").FormulaR1C1 = "=RC[1]*RC[2]"
Sheets(i).Range("F:F").Value = Sheets(i).Range("F:F").Value
Next i
End Sub
no need show formulas, don't repeat insert column when every time run the macro and show numbers as formatting when insert column .
I have two sheet to implement that.
than