Hi Everyone,
I am fairly new to VBA after recently undertaking (well, still going) an online VBA course. I've used this forum a lot to learn different code, as although the course is fantastic for building foundations, as you all know, it takes a lot more practice than just a short course to learn VBA. So thank you to all the posters out there that give such detailed answers to help people like me!
I have an issue that I haven't seemed to find a relevant answer for...I am wanting to learn the best VBA code for a quite simple task in Excel without VBA, however I need a macro for this as (using a macro) I am copying data from the same workbook into a new worksheet & then re-pasting the numbers as values (original data is formula referencing another worksheet), but I need some data to be new formula. What I would like to do is look up column A and if it has the word 'total' in it, then sum the corresponding values for that row for all cells above (up to the first blank row - like 'autosum' does).
Here's a quick example - so for the rows that have 'total income' and 'total expenditure', I'd like the other 3 values in that row/s to sum the amounts above
<colgroup><col><col span="3"></colgroup><tbody>
</tbody>
Thank you!
I am fairly new to VBA after recently undertaking (well, still going) an online VBA course. I've used this forum a lot to learn different code, as although the course is fantastic for building foundations, as you all know, it takes a lot more practice than just a short course to learn VBA. So thank you to all the posters out there that give such detailed answers to help people like me!
I have an issue that I haven't seemed to find a relevant answer for...I am wanting to learn the best VBA code for a quite simple task in Excel without VBA, however I need a macro for this as (using a macro) I am copying data from the same workbook into a new worksheet & then re-pasting the numbers as values (original data is formula referencing another worksheet), but I need some data to be new formula. What I would like to do is look up column A and if it has the word 'total' in it, then sum the corresponding values for that row for all cells above (up to the first blank row - like 'autosum' does).
Here's a quick example - so for the rows that have 'total income' and 'total expenditure', I'd like the other 3 values in that row/s to sum the amounts above
Income | Jan | Feb | Mar |
Account A | 10 | 20 | 50 |
Account B | 10 | 10 | 10 |
Account C | 10 | 30 | 40 |
Total Income | 30 | 60 | 100 |
Expenditure | |||
Account A | 10 | 10 | 50 |
Account B | 20 | 5 | 10 |
Account C | 10 | 15 | 30 |
Total Expenditure | 40 | 30 | 90 |
Net Profit | -10 | 30 | 10 |
<colgroup><col><col span="3"></colgroup><tbody>
</tbody>
Thank you!