I've been working on this VBA code for 2 weeks already and I can't figure out the right code to generate the sums of rows and columns vector. This is an input-output table of 12x12 matrix.
For columns (which are import data), I need to generate the sums of columns: example for range "D21", the sum of "E8:E19" minus "E8"; for range "D22", the sum of "E8-E19" minus "E9".. I need to do the same calculations for the rest of cells in green color.
For rows (which are export data), I need to generate the sums of rows: example for range Q8, the sum of (E8:P8)-E8; Q9, the sum of (E9:P9)-E9.. and so on. I need to sum all the data in each cells excluding the diagonal elements/cells in blue.
My professor asked me to construct the VBA code using subroutine test and loops but I really can't figure it out.
Hope someone can help me construct the VBA code for this.
Please see the excel file in this link (as I cannot attach a copy of the image), data in sheet 3.
https://asiandevbank-my.sharepoint....BNn3y2D24_2IcBGhNuhNAE1v6tg1UJZJAr8w?e=DBBQbj
Would be very grateful for you help.
For columns (which are import data), I need to generate the sums of columns: example for range "D21", the sum of "E8:E19" minus "E8"; for range "D22", the sum of "E8-E19" minus "E9".. I need to do the same calculations for the rest of cells in green color.
For rows (which are export data), I need to generate the sums of rows: example for range Q8, the sum of (E8:P8)-E8; Q9, the sum of (E9:P9)-E9.. and so on. I need to sum all the data in each cells excluding the diagonal elements/cells in blue.
My professor asked me to construct the VBA code using subroutine test and loops but I really can't figure it out.
Hope someone can help me construct the VBA code for this.
Please see the excel file in this link (as I cannot attach a copy of the image), data in sheet 3.
https://asiandevbank-my.sharepoint....BNn3y2D24_2IcBGhNuhNAE1v6tg1UJZJAr8w?e=DBBQbj
Would be very grateful for you help.