Earlgrey79
New Member
- Joined
- Feb 10, 2022
- Messages
- 1
- Office Version
- 2021
Hello, I'm a complete newbie to Macros and VBA, and I was wondering if someone could help me with a Macro that I need for a template sheet for accounting entries.
What I need is a macro that automatically inserts a row below only if the sum of "Importe" (column D) is not 0. (If it equals 0, nothing should be done).
For example, starting from here:
(Here, the sum of "Importe" column is -100,00)
I need a new row that always looks like this:
"Importe" (Column D) has to show a value that makes the sum equal 0. In this example, it should show 100,00.
The rest of the values should always be "701500" for column A, "99000" for column B, blank for Column C, "H" for column E, "AAT" for column F and "AJUSTE" for column G
So it would look like this:
Being able to do to this would save me a lot of time (that I could spend on working more, lol), so I'd be very grateful.
Thank you!
What I need is a macro that automatically inserts a row below only if the sum of "Importe" (column D) is not 0. (If it equals 0, nothing should be done).
For example, starting from here:
| Centro | Auxiliar | Importe | D/H | DES | Ref1 | Ref2 | Ref3 | Ref4 | Obra | Mon | ImporteME | Descripción | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
430070 | 99900 | 00077003 | 5000,00 | H | AAT | 22001189 | ||||||||
433000 | 86000 | 00077003 | -4000,00 | H | AAT | 86010016 | ||||||||
433000 | 86000 | 00077003 | -1100,00 | H | AAT | 86010018 |
(Here, the sum of "Importe" column is -100,00)
I need a new row that always looks like this:
CuentaMayor | Centro | Auxiliar | Importe | D/H | DES | Ref1 | Ref2 | Ref3 | Ref4 | Obra | Mon | ImporteME | Descripción |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
701500 | 99000 | value that makes the sum = 0 | H | AAT | AJUSTE |
"Importe" (Column D) has to show a value that makes the sum equal 0. In this example, it should show 100,00.
The rest of the values should always be "701500" for column A, "99000" for column B, blank for Column C, "H" for column E, "AAT" for column F and "AJUSTE" for column G
So it would look like this:
| Centro | Auxiliar | Importe | D/H | DES | Ref1 | Ref2 | Ref3 | Ref4 | Obra | Mon | ImporteME | Descripción | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
430070 | 99900 | 00077003 | 5000,00 | H | AAT | 22001189 | ||||||||
433000 | 86000 | 00077003 | -4000,00 | H | AAT | 86010016 | ||||||||
433000 | 86000 | 00077003 | -1100,00 | H | AAT | 86010018 | ||||||||
701500 | 99000 | 100,00 | H | AAT | AJUSTE |
Being able to do to this would save me a lot of time (that I could spend on working more, lol), so I'd be very grateful.
Thank you!