I am totally green when it comes to VBA. Got a new job and have to take some existing code and modify it.
The script takes a worksheet with +- 25000 lines and divides it in about 300 new sheets. On each sheet, I need to have a total. I created a macro that finds the last cell, move down one and sums up the values above. That part of the script is as follows:
Application.Goto Reference:="R7C2"
Application.Goto Reference:="R7C7"
Selection.End(xlDown).Select
Range("G460"
.Select
ActiveCell.FormulaR1C1 = "=SUM(R[-456]C:R[-1]C)"
Range("G461"
.Select
The problem is with the SUM R[-456]. I want to change that part because from one sheet to the next, there is never the same number of line. How do I make it dynamic.
I desperately need help as I am not even familiar with the VBA sytax yet.
Thank to anyone who is willing to give me a hint.
The script takes a worksheet with +- 25000 lines and divides it in about 300 new sheets. On each sheet, I need to have a total. I created a macro that finds the last cell, move down one and sums up the values above. That part of the script is as follows:
Application.Goto Reference:="R7C2"
Application.Goto Reference:="R7C7"
Selection.End(xlDown).Select
Range("G460"
ActiveCell.FormulaR1C1 = "=SUM(R[-456]C:R[-1]C)"
Range("G461"
The problem is with the SUM R[-456]. I want to change that part because from one sheet to the next, there is never the same number of line. How do I make it dynamic.
I desperately need help as I am not even familiar with the VBA sytax yet.
Thank to anyone who is willing to give me a hint.