Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

By John

Sub DelColumn
    Dim oSheets As Variant
    Dim oSheet As Variant
    Dim oColumns As Variant

            oSheets = ThisComponent.getSheets()     ' All sheets of this workbook
            oSheet = oSheets.getByName("Sheet1")    ' One sheet with name "Sheet1" (for example)
            oColumns = oSheet.getColumns()  ' All columns of this sheet as object (with some metods)

            oColumns.removeByIndex(1, 3)    ' Remove 3 columns from B (B-C-D)
            oColumns.removeByIndex(6, 1)    ' Remove one column (now it is column G - 6th)
    End Sub

Thnks John