View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
PY & Associates[_4_] PY & Associates[_4_] is offline
external usenet poster
 
Posts: 46
Default Replacing subtotal with a formula

I tested this OK.
The rest is easy.

=====
Dim i As Integer
Dim srow As Integer
Dim erow As Integer

Sub main()
For i = 15 To Range("B1000").End(xlUp).Row
startrow
endrow
Next i
End Sub

Sub startrow()
Do Until Range("B" & i) = "IN"
i = i + 1
Loop
srow = i
End Sub

Sub endrow()
Do Until Range("B" & i) < "IN"
i = i + 1
Loop
erow = i - 1
End Sub


"iltheas" wrote:

Yup, in this case, the result is the same, but if the subtotal is not a
formula, if I were to edit any of the figure, I would have to
recalculate the subtotal. The example is only showing 4 records, while
the actual file may show thousands of records.