T
transferxxx
Can anybody pls help me to modify this code to make this work with
adjacent column(more than 1 coumn) i.e if my selection is A120 -
instead of A1:A20
(The macro works fine for a selection of A1:A20 but not A120)
Sub addsubtotalrange()
'
For Each NumRange In Selection.SpecialCells(xlConstants,
xlNumbers).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 1).Formula =
"=SUBTOTAL(9," & SumAddr & ")"
Next NumRange
'
End Sub
adjacent column(more than 1 coumn) i.e if my selection is A120 -
instead of A1:A20
(The macro works fine for a selection of A1:A20 but not A120)
Sub addsubtotalrange()
'
For Each NumRange In Selection.SpecialCells(xlConstants,
xlNumbers).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 1).Formula =
"=SUBTOTAL(9," & SumAddr & ")"
Next NumRange
'
End Sub