By way of info, the following should (but not tested!) execute the instructions I listed out:
Code:
Sub CellTest()
Const intColumn As Integer = 4
Const intStartRow As Integer = 1
Const intEndRow As Integer = 69
Const strOutput As String = "O3"
Dim sh As Worksheet
Dim intRow As Integer
Dim Total As Double
Dim booSumming As Boolean
' Set up the worksheet we're interested in
Set sh = ThisWorkbook.Sheets("Sheet1")
' Set starting values
Total = 0
booSumming = False
' Loop through every row
For intRow = intStartRow To intmaxrow
' If we're summing then add to the total
If booSumming Then
If IsNumeric(sh.Cells(intRow, intColumn).Value) Then Total = Total + sh.Cells(intRow, intColumn).Value
' If we're not yet summing then check borders
Else
If Cells(intRow, intColumn).Borders(xlEdgeTop).LineStyle = xlDouble Then
booSumming = True
Total = sh.Cells(intRow, intColumn).Value
End If
End If
Next intRow
' Output Result
sh.Range(strOutput).Value = Total
End Sub