Hi all,
having a little problem with a range selection, the following line:
RngData.Range(RngData.Cells(2, 4), RngData.Cells(RngData.Rows.Count, 4)). _
FormulaR1C1 = "=SUM(RC[+1]:RC[+" & RngData.Columns.Count - 4 & "])"
is inserting the formula into a range offset 2 rows from where it should so it starts 3 rows below the header row instead of 1.
I have tested a bit further and this line:
RngData.Cells(2, 4).Select
selects a different cell to this line:
RngData.Range(RngData.Cells(2, 4), RngData.Cells(2, 4)).Select
I assume I've just forgotten something basic as it's been a while since I last coded in XL.
Thanks
Alex
having a little problem with a range selection, the following line:
RngData.Range(RngData.Cells(2, 4), RngData.Cells(RngData.Rows.Count, 4)). _
FormulaR1C1 = "=SUM(RC[+1]:RC[+" & RngData.Columns.Count - 4 & "])"
is inserting the formula into a range offset 2 rows from where it should so it starts 3 rows below the header row instead of 1.
I have tested a bit further and this line:
RngData.Cells(2, 4).Select
selects a different cell to this line:
RngData.Range(RngData.Cells(2, 4), RngData.Cells(2, 4)).Select
I assume I've just forgotten something basic as it's been a while since I last coded in XL.
Thanks
Alex