View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Find the range of a SubTotal

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