hi
I use vba code, that I found here, to sum dynamic length columns, which works very well. I tried to change the formula to do a 'sumif', and im getting an 'application-defined or object-defined' error. following is the formula I am using.
TheFormula = "=sumif(" & lastCellg & ":" & firstCellg & "," & ">0" & "," & lastCell & ":" & firstCell & ")"
lastcellg and firstcellg are the range variable, lastcell and firstcell are the sum range.
can someone please help me with this formula. thanks.
I use vba code, that I found here, to sum dynamic length columns, which works very well. I tried to change the formula to do a 'sumif', and im getting an 'application-defined or object-defined' error. following is the formula I am using.
TheFormula = "=sumif(" & lastCellg & ":" & firstCellg & "," & ">0" & "," & lastCell & ":" & firstCell & ")"
lastcellg and firstcellg are the range variable, lastcell and firstcell are the sum range.
can someone please help me with this formula. thanks.