Hello,
I have a range with several columns (the number can vary) and 58 rows. The header is a named range ("Headers") in row2. In the headers, the string Total can appear several times as in Total x, Total Y, Total Z and so on.
Rows from 6 to 58 contain numbers.
I would like to add a formula to the right that adds up all the figures in the same row for all the columns which contain the string "Total" in the header.
So, say the the current range is A2 to U58: if there are three column headers containing the string Total (column N, Q and R) , the macro should add in cell V6 the formula N6+Q6+R6 that would then be filled down to row 58.
I guess this could be achived with an Array. Would anyone please point me to the right direction? I can manage to achieve most of this but I find Arrays and the approximate matches tricky.
Many thanks in advance
I have a range with several columns (the number can vary) and 58 rows. The header is a named range ("Headers") in row2. In the headers, the string Total can appear several times as in Total x, Total Y, Total Z and so on.
Rows from 6 to 58 contain numbers.
I would like to add a formula to the right that adds up all the figures in the same row for all the columns which contain the string "Total" in the header.
So, say the the current range is A2 to U58: if there are three column headers containing the string Total (column N, Q and R) , the macro should add in cell V6 the formula N6+Q6+R6 that would then be filled down to row 58.
I guess this could be achived with an Array. Would anyone please point me to the right direction? I can manage to achieve most of this but I find Arrays and the approximate matches tricky.
Many thanks in advance