Thread: Subtotal
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
al007 al007 is offline
external usenet poster
 
Posts: 118
Default Subtotal

Can anyone tell me how I can amend the macro below works for cells
containing both values & formulas in the areas

Sub subtotalrange()
'

'
For Each NumRange In Selection.SpecialCells(xlConstants,
xlNumbers).Areas

SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 1).Resize(1, 1).Formula =
"=SUBTOTAL(9," & SumAddr & ")"

Next NumRange
'
End Sub

Thxs