Remove Subtotal Excel Add-in VBA (Visual Basic for Applications)

Remove Subtotal Excel Add-in VBA (Visual Basic for Applications)

RemoveSubtotal

Method removes subtotal from selected range in a sheet. Remove subtotal method is very useful when you have old calculated data and want to make certain changes like adding another column and perform re-subtotal.

Syntax

Range.RemoveSubtotal

Data source

Code example

Public Sub RemoveSubTotalExample()
    'Declare range object
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Remove subtotal
    oRange.RemoveSubtotal
    
    'Cleanup
    If Not oRange Is Nothing Then
        Set oRange = Nothing
    End If
End Sub

Output

Next >> Understand Paste Special Excel Add-in code example

Leave a Reply

Your email address will not be published.