K0st4din
Well-known Member
- Joined
- Feb 8, 2012
- Messages
- 501
- Office Version
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hello, everyone!
Friends, I ask for your cooperation, in my opinion, for some macro to replace the formulas I am working with at the moment.
I have two worksheets with tables in them - IME SLUJITEL and PREDSTAVITELNI.
In SHEET PREDSTAVITELNI, I try in column B of the table, with drop-down menus to export specific words that I need. These words are in column Q (and new words are added each month). In column H - money is applied.
In the worksheet IME SLUJITEL in column G (in the table), I use a formula which if it sees the words written in the other worksheet in column B (in the table) returns or if the date is the same, then according to the words returns the monetary value or sum of the sum , because the date is the same. (In the example, for example, the date is 14.6.2021 and the sum is 35.
So far, I manage by hand in column G in the formula to add each word by hand so that the corresponding amounts can be obtained according to the date.
What makes it difficult for me and I do not know how to do it - is how with a macro, if I have to add a new word in PREDSTAVITELNI in column Q, to add it automatically so I can avoid this insertion by hand.
I very much hope that I have explained everything understandable.
Please, if you have any misunderstandings, ask so I can help with more clarifications.
Thank you in advance for everyone's cooperation.
Friends, I ask for your cooperation, in my opinion, for some macro to replace the formulas I am working with at the moment.
I have two worksheets with tables in them - IME SLUJITEL and PREDSTAVITELNI.
In SHEET PREDSTAVITELNI, I try in column B of the table, with drop-down menus to export specific words that I need. These words are in column Q (and new words are added each month). In column H - money is applied.
In the worksheet IME SLUJITEL in column G (in the table), I use a formula which if it sees the words written in the other worksheet in column B (in the table) returns or if the date is the same, then according to the words returns the monetary value or sum of the sum , because the date is the same. (In the example, for example, the date is 14.6.2021 and the sum is 35.
So far, I manage by hand in column G in the formula to add each word by hand so that the corresponding amounts can be obtained according to the date.
What makes it difficult for me and I do not know how to do it - is how with a macro, if I have to add a new word in PREDSTAVITELNI in column Q, to add it automatically so I can avoid this insertion by hand.
I very much hope that I have explained everything understandable.
Please, if you have any misunderstandings, ask so I can help with more clarifications.
Thank you in advance for everyone's cooperation.
TEST AUTO ADD.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | |||||||||
2 | на | ||||||||
3 | МПС рег.№ | ||||||||
4 | 2021 | 6 | за времето от | 1.6.2021 | до | 30.6.2021 | |||
5 | |||||||||
6 | day | form | Travel | ||||||
7 | mon | legend | cyti | disel | ddd | night | pred | ||
8 | 1 | ||||||||
9 | 2 | ||||||||
10 | 3 | ||||||||
11 | 4 | ||||||||
12 | 5 | 35.00 | |||||||
13 | 6 | ||||||||
14 | 7 | ||||||||
15 | 8 | ||||||||
16 | 9 | ||||||||
17 | 10 | ||||||||
18 | 11 | ||||||||
19 | 12 | ||||||||
20 | 13 | ||||||||
21 | 14 | 35.00 | |||||||
22 | 15 | ||||||||
23 | 16 | ||||||||
24 | 17 | ||||||||
25 | 18 | ||||||||
26 | 19 | ||||||||
27 | 20 | ||||||||
28 | 21 | ||||||||
29 | 22 | ||||||||
30 | 23 | ||||||||
31 | 24 | 25.00 | |||||||
32 | 25 | ||||||||
33 | 26 | ||||||||
34 | 27 | ||||||||
35 | 28 | ||||||||
36 | 29 | ||||||||
37 | 30 | ||||||||
38 | 1 | ||||||||
39 | TOTAL | 0.00 лв. | 0.00 лв. | 0.00 лв. | 95.00 лв. | ||||
IME SLUJITEL |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D8:D38 | D8 | =IF(SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,'IME SLUJITEL'!$D$7,PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8)=0,"",SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,'IME SLUJITEL'!$D$7,PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8)) |
E8:E38 | E8 | =IF($C8="Извънградско", 40, IF($C8="Градско", 20,"")) |
F8:F38 | F8 | =IF(SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,'IME SLUJITEL'!$F$7,PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8)=0,"",SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,'IME SLUJITEL'!$F$7,PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8)) |
G8:G38 | G8 | =IF(SUM(SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,{"GORIVO";"AVTOMOBILI";"POCHERPKI";"HRANA";"OBQD";"TALON PARKING";"AVTOMIVKA";"NOSHUVKI";"MEDICINSKI KONSUMATIVI";"KOMANDIROVYCHNI";"KANCELARSKI MATERIALI";"OFIS KONSUMATIVI";"OFIS TEHNIKA";"TEHNIKA";"STROITELNI MATERIALI";"OBUCHENIE";"PCR TEST";"PODARYK ROJDEN DEN";"PODARYK IMEN DEN"},PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8))=0,"",SUM(SUMIFS(PREDSTAVITELNI!$H$6:$H$65,PREDSTAVITELNI!$B$6:$B$65,{"GORIVO";"AVTOMOBILI";"POCHERPKI";"HRANA";"OBQD";"TALON PARKING";"AVTOMIVKA";"NOSHUVKI";"MEDICINSKI KONSUMATIVI";"KOMANDIROVYCHNI";"KANCELARSKI MATERIALI";"OFIS KONSUMATIVI";"OFIS TEHNIKA";"TEHNIKA";"STROITELNI MATERIALI";"OBUCHENIE";"PCR TEST";"PODARYK ROJDEN DEN";"PODARYK IMEN DEN"},PREDSTAVITELNI!$A$6:$A$65,'IME SLUJITEL'!$A8))) |
D39:G39 | D39 | =SUM(D8:D38) |
A8 | A8 | =DATE(godina,$B$4,1) |
A9 | A9 | =DATE(godina,$B$4,2) |
A10 | A10 | =DATE(godina,$B$4,3) |
A11 | A11 | =DATE(godina,$B$4,4) |
A12 | A12 | =DATE(godina,$B$4,5) |
A13 | A13 | =DATE(godina,$B$4,6) |
A14 | A14 | =DATE(godina,$B$4,7) |
A15 | A15 | =DATE(godina,$B$4,8) |
A16 | A16 | =DATE(godina,$B$4,9) |
A17 | A17 | =DATE(godina,$B$4,10) |
A18 | A18 | =DATE(godina,$B$4,11) |
A19 | A19 | =DATE(godina,$B$4,12) |
A20 | A20 | =DATE(godina,$B$4,13) |
A21 | A21 | =DATE(godina,$B$4,14) |
A22 | A22 | =DATE(godina,$B$4,15) |
A23 | A23 | =DATE(godina,$B$4,16) |
A24 | A24 | =DATE(godina,$B$4,17) |
A25 | A25 | =DATE(godina,$B$4,18) |
A26 | A26 | =DATE(godina,$B$4,19) |
A27 | A27 | =DATE(godina,$B$4,20) |
A28 | A28 | =DATE(godina,$B$4,21) |
A29 | A29 | =DATE(godina,$B$4,22) |
A30 | A30 | =DATE(godina,$B$4,23) |
A31 | A31 | =DATE(godina,$B$4,24) |
A32 | A32 | =DATE(godina,$B$4,25) |
A33 | A33 | =DATE(godina,$B$4,26) |
A34 | A34 | =DATE(godina,$B$4,27) |
A35 | A35 | =DATE(godina,$B$4,28) |
A36 | A36 | =DATE(godina,$B$4,29) |
A37 | A37 | =DATE(godina,$B$4,30) |
A38 | A38 | =DATE(godina,$B$4,31) |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
godina | ='IME SLUJITEL'!$A$4 | A8:A38 |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
F8:G38 | Any value | |
A4 | List | =$T$2:$T$32 |
B4 | List | =$U$2:$U$13 |
B8:B38 | List | =$B$41:$B$45 |
C8:C38 | List | =$C$56:$C$57 |
D8:D38 | Any value |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D2 | D2 | ='IME SLUJITEL'!C2 |
D3,G3 | D3 | ='IME SLUJITEL'!D4 |
A6:A65 | A6 | =IFERROR(G6," ") |
N6:N65 | N6 | =CHOOSE(WEEKDAY($G6),"Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота") |
H66 | H66 | =SUM(H6:H65) |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
B6:B65 | List | =Categoriq |
C6:C65 | List | =OFFSET(INDIRECT(SUBSTITUTE($B6;" ";""));0;0;COUNTA(INDIRECT(SUBSTITUTE($B6;" ";"")&"Col"));1) |
D6:D65 | Any value | |
E6:E65 | List | =OFFSET($S$2;0;0;COUNTA($S:$S);1) |