I need for the code below to add all of the cells to row 69 in the D column after the bordered P2 row is found and place the results in cell O3. Can someone help me - I think I have most of it except for the last line of the code below. Thanks in advance.
Public const Sales_Units_column = "03"
Public Sub SalesUntColumnAfterP2()
Dim P5Row As Long
'Get P5 Row
For P5Row = Me.dataStartsIndex To engine.template.lastDataRow
If cells(P2Row, SALES_UNITS_COLUMN).Borders(xlEdgeTop). _
LineStyle = xlDouble Then
Exit For
End If
Next P5Row
'[]
'Change formulas starting with the row after the P2 row
Dim range_ As String
Dim i As Integer
For i = P5Row + 1 To engine.template.lastDataRow
range_ = SALES_UNITS_COLUMN & i
I believe this needs to be changed:
templateSheet.Range(range_).Formula = "=W" & 300 + i
Next i
End Sub
Public const Sales_Units_column = "03"
Public Sub SalesUntColumnAfterP2()
Dim P5Row As Long
'Get P5 Row
For P5Row = Me.dataStartsIndex To engine.template.lastDataRow
If cells(P2Row, SALES_UNITS_COLUMN).Borders(xlEdgeTop). _
LineStyle = xlDouble Then
Exit For
End If
Next P5Row
'[]
'Change formulas starting with the row after the P2 row
Dim range_ As String
Dim i As Integer
For i = P5Row + 1 To engine.template.lastDataRow
range_ = SALES_UNITS_COLUMN & i
I believe this needs to be changed:
templateSheet.Range(range_).Formula = "=W" & 300 + i
Next i
End Sub