Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to find the range that a SubTotal function refers to?
i.e. cell value is "=SUBTOTAL(9,J25:J31)" Within the macro I want to determine the range of rows referred to in this cell (25-31). -- Regards; Rob ------------------------------------------------------------------------ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As long as you're looking for cells on the same worksheet, you can look at
..precedents. Option Explicit Sub testme() Dim myPrecedents Dim myCell As Range Set myCell = ActiveSheet.Range("a1") With myCell .Formula = "=SUBTOTAL(9,J25:J31)" MsgBox .Precedents.Address(0, 0) End With End Sub RWN wrote: Is it possible to find the range that a SubTotal function refers to? i.e. cell value is "=SUBTOTAL(9,J25:J31)" Within the macro I want to determine the range of rows referred to in this cell (25-31). -- Regards; Rob ------------------------------------------------------------------------ -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave;
That put me on the right track - missed a mental connection to "Precedents". (was extracting from a "FormulaArray" but KNEW there had to be an easier way-if not 30 different ways.) Turns out that; Cells(StRow, StCol).Precedents.Select For Each cl In Selection ' Do the tax exclusion using "Cells(cl.Row, cl.Column)" Next Is what I wanted Again, thanks. -- Regards; Rob ------------------------------------------------------------------------ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To find subtotal - Please help | Excel Discussion (Misc queries) | |||
subtotal by a range | New Users to Excel | |||
Subtotal of Abs of a range? | Excel Worksheet Functions | |||
Find, Loop, Subtotal | Excel Programming | |||
Find, Loop, Subtotal | Excel Programming |