i've been trying to modify Macro5() to Macro6()
but it doesn't work, can help , thanks

Sub Macro5()

    Range("J5151").Select
    ActiveCell.FormulaR1C1 = _
        "=TREND(R[-365]C[5]:R[-152]C[5],R[-365]C[-8]:R[-152]C[-8],RC[-8])"
End Sub

Sub Macro6()

Dim row1 As Long
Dim row2 As Long
Dim row3 As Long
Dim col1 As Long
Dim col2 As Long


    Range("J5151").Select
    ActiveCell.FormulaR1C1 = _
        "=TREND(cells(row1,col1):cells(row2,col1),cells(row1,col2):cells(row2,col2),cells(row3,col2))"
End Sub