abdo meghari
Well-known Member
- Joined
- Aug 3, 2021
- Messages
- 606
- Office Version
- 2019
hello,
I would rename sheet based on amount is existed in last row for column F when the sheet is active.
I try with this
data before
what I want
I would rename sheet based on amount is existed in last row for column F when the sheet is active.
I try with this
VBA Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim lr As Long
lr = Range("F" & Rows.Count).End(xlUp).Row
ActiveSheet.Name = Format("INVOICE" & " " & lr, "#,##0.00")
End Sub
OUTPUT.xlsm | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
21 | ITEM | BRAND | QTY | PRICE | BALANCE | ||
22 | 1 | VEGA 70A R KOR | 4.00 | 500.00 | 2,000.00 | ||
23 | 2 | VEGA 55A R KOR | 2.00 | 425.00 | 850.00 | ||
24 | 3 | LARGEST 60A L HIGH JAP | 2.00 | 440.00 | 880.00 | ||
25 | 4 | KM 215/65R16 TA31 KOR | 4.00 | 460.00 | 1,840.00 | ||
26 | 5 | 265/70R16 ALGERIA | 4.00 | 630.00 | 2,520.00 | ||
27 | 6 | KM 205/65R16 HS63 KOR | 4.00 | 445.00 | 1,780.00 | ||
28 | 7 | GC 385/65R22.5 AT131 CHI | 2.00 | 1,650.00 | 3,300.00 | ||
29 | 8 | KM 265/70R16 KOR | 4.00 | 880.00 | 3,520.00 | ||
30 | 9 | DONGA 66A L KOR | 2.00 | 460.00 | 920.00 | ||
31 | 10 | KM 235/65R17 HP71 KOR | 4.00 | 625.00 | 2,500.00 | ||
32 | 11 | KM 235/55R19 PS71 KOR | 4.00 | 675.00 | 2,700.00 | ||
33 | 12 | DROUB 90A L KOR | 1.00 | 575.00 | 575.00 | ||
34 | 13 | KM 13R22.5 MA11 KOR | 2.00 | 2,550.00 | 5,100.00 | ||
35 | TOTAL | 39.00 | 28,485.00 | ||||
SH1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D35,F35 | D35 | =SUM(D22:D34) |
F22:F34 | F22 | =E22*D22 |
OUTPUT.xlsm | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
21 | ITEM | BRAND | QTY | PRICE | BALANCE | ||
22 | 1 | VEGA 70A R KOR | 1.00 | 500.00 | 500.00 | ||
23 | 2 | VEGA 55A R KOR | 2.00 | 425.00 | 850.00 | ||
24 | 3 | LARGEST 60A L HIGH JAP | 2.00 | 440.00 | 880.00 | ||
25 | 4 | KM 215/65R16 TA31 KOR | 1.00 | 460.00 | 460.00 | ||
26 | 5 | 265/70R16 ALGERIA | 4.00 | 630.00 | 2,520.00 | ||
27 | 6 | KM 205/65R16 HS63 KOR | 4.00 | 450.00 | 1,800.00 | ||
28 | 7 | GC 385/65R22.5 AT131 CHI | 12.00 | 1,640.00 | 19,680.00 | ||
29 | 8 | KM 265/70R16 KOR | 4.00 | 880.00 | 3,520.00 | ||
30 | 9 | KM 235/65R17 HP71 KOR | 1.00 | 875.00 | 875.00 | ||
31 | 10 | KM 235/55R19 PS71 KOR | 2.00 | 670.00 | 1,340.00 | ||
32 | TOTAL | 33.00 | 32,425.00 | ||||
IN1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D32,F32 | D32 | =SUM(D22:D31) |
F22:F31 | F22 | =E22*D22 |
what I want
OUTPUT.xlsm | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
21 | ITEM | BRAND | QTY | PRICE | BALANCE | ||
22 | 1 | VEGA 70A R KOR | 4.00 | 500.00 | 2,000.00 | ||
23 | 2 | VEGA 55A R KOR | 2.00 | 425.00 | 850.00 | ||
24 | 3 | LARGEST 60A L HIGH JAP | 2.00 | 440.00 | 880.00 | ||
25 | 4 | KM 215/65R16 TA31 KOR | 4.00 | 460.00 | 1,840.00 | ||
26 | 5 | 265/70R16 ALGERIA | 4.00 | 630.00 | 2,520.00 | ||
27 | 6 | KM 205/65R16 HS63 KOR | 4.00 | 445.00 | 1,780.00 | ||
28 | 7 | GC 385/65R22.5 AT131 CHI | 2.00 | 1,650.00 | 3,300.00 | ||
29 | 8 | KM 265/70R16 KOR | 4.00 | 880.00 | 3,520.00 | ||
30 | 9 | DONGA 66A L KOR | 2.00 | 460.00 | 920.00 | ||
31 | 10 | KM 235/65R17 HP71 KOR | 4.00 | 625.00 | 2,500.00 | ||
32 | 11 | KM 235/55R19 PS71 KOR | 4.00 | 675.00 | 2,700.00 | ||
33 | 12 | DROUB 90A L KOR | 1.00 | 575.00 | 575.00 | ||
34 | 13 | KM 13R22.5 MA11 KOR | 2.00 | 2,550.00 | 5,100.00 | ||
35 | TOTAL | 39.00 | 28,485.00 | ||||
INVOICE 28,485.00 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D35,F35 | D35 | =SUM(D22:D34) |
F22:F34 | F22 | =E22*D22 |
OUTPUT.xlsm | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
21 | ITEM | BRAND | QTY | PRICE | BALANCE | ||
22 | 1 | VEGA 70A R KOR | 1.00 | 500.00 | 500.00 | ||
23 | 2 | VEGA 55A R KOR | 2.00 | 425.00 | 850.00 | ||
24 | 3 | LARGEST 60A L HIGH JAP | 2.00 | 440.00 | 880.00 | ||
25 | 4 | KM 215/65R16 TA31 KOR | 1.00 | 460.00 | 460.00 | ||
26 | 5 | 265/70R16 ALGERIA | 4.00 | 630.00 | 2,520.00 | ||
27 | 6 | KM 205/65R16 HS63 KOR | 4.00 | 450.00 | 1,800.00 | ||
28 | 7 | GC 385/65R22.5 AT131 CHI | 12.00 | 1,640.00 | 19,680.00 | ||
29 | 8 | KM 265/70R16 KOR | 4.00 | 880.00 | 3,520.00 | ||
30 | 9 | KM 235/65R17 HP71 KOR | 1.00 | 875.00 | 875.00 | ||
31 | 10 | KM 235/55R19 PS71 KOR | 2.00 | 670.00 | 1,340.00 | ||
32 | TOTAL | 33.00 | 32,425.00 | ||||
INVOICE 32,425.00 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D32,F32 | D32 | =SUM(D22:D31) |
F22:F31 | F22 | =E22*D22 |