View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_25_] Stuart[_25_] is offline
external usenet poster
 
Posts: 2
Default identifying subtotals

Providing that you have a continuous stream of data in row "A" (No empty
cells!) then the following will work. If you do have gaps then you may need
to use the following as the selection method
Range(Range("A1"), Range("A50000").end(xlup).Select

May be someone else can help out here, in the following sub what should i be
declaring "rng" as ?

Sub totalRows()
Dim rng As Variant

Range(Range("A1"), Range("A1").End(xlDown)).Select
For Each rng In Selection
If Right(rng.Value, 5) = "Total" Then
MsgBox rng.Row & " is a subTotal row"
End If
Next rng
End Sub




"Darren Ludlam" wrote in message
...
How can I dynamically identify if a row is a subtotal