A
AHizon via OfficeKB.com
Hello,
I recorded a Macros & modified slightly to select the last column and last
nonblank cell in that column, but I would like to know how to find the last
nonblank column and last nonblank cell in that column to sum all the column
after the header. Below is the coding that I have:
Range("A1").Select
Selection.End(xlToRight).Select
Selection.End(xlDown).Select
Range("K" & Rows.Count).End(xlUp).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-27]C:R[-1]C)-R[-27]C[-8]"
I want Column "K" to be dynamic so that it finds the last column instead of
hard coding to only Column K. I would also like the formula to be dynamic so
that it sums all the cells above the last nonblank cell minus cell(C2). Can
anyone assist me with this?
Thanks,
Abigail
I recorded a Macros & modified slightly to select the last column and last
nonblank cell in that column, but I would like to know how to find the last
nonblank column and last nonblank cell in that column to sum all the column
after the header. Below is the coding that I have:
Range("A1").Select
Selection.End(xlToRight).Select
Selection.End(xlDown).Select
Range("K" & Rows.Count).End(xlUp).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-27]C:R[-1]C)-R[-27]C[-8]"
I want Column "K" to be dynamic so that it finds the last column instead of
hard coding to only Column K. I would also like the formula to be dynamic so
that it sums all the cells above the last nonblank cell minus cell(C2). Can
anyone assist me with this?
Thanks,
Abigail