ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   identifying subtotals (https://www.excelbanter.com/excel-programming/326685-identifying-subtotals.html)

Dave Peterson[_5_]

identifying subtotals
 
Look for a cell in that row that has a formula that starts with "=subtotal("?

Darren Ludlam wrote:

How can I dynamically identify if a row is a subtotal


--

Dave Peterson

Stuart[_25_]

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





Dave Peterson[_5_]

identifying subtotals
 
dim rng as range

seems to make a lot of sense here.

Stuart wrote:

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



--

Dave Peterson

Darren Ludlam

identifying subtotals
 
How can I dynamically identify if a row is a subtotal




All times are GMT +1. The time now is 03:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com