麻辣家族討論版版's Archiver

yangjie 發表於 2017-11-4 13:56

ListBox2刪除某列

請教大大:
Sub showlastdatas()
    Dim str1 As String
    wb3.Activate
    str1 = Left(TextBox31, 5) & CommandButton4.Caption
    With Sheets(str1)
        row1 = .Cells(65536, 4).End(xlUp).Row
        If row1 < 2 Then Exit Sub
        Dim mystr As String
        With Application.Names.Add("Tmp2", .Range(.Cells(2, 1), .Cells(row1, 24)))
            mystr = .RefersTo
            .Delete
        End With
        ListBox2.RowSource = ""
        With ListBox2
            .ColumnCount = 24
            .ColumnWidths = "68pt;60pt;45pt;60pt;----------------"
            .RowSource = mystr
            .ColumnHeads = True
            .ListIndex = ListBox2.ListCount - 1
        End With
    End With
End Sub
ListBox顯示時,可否刪除某一列資料?(Excel活頁內容沒刪)應如何處理
或篩選某條件下才list

linyancheng 發表於 2017-11-5 00:01

ListBox2•.RemoveItem N
N表示列序
先以迴遷篩選要刪除的列,如果可以從底部往上刪。

yangjie 發表於 2017-11-10 13:53

ListBox2•.RemoveItem N
ListBox2少一列
是否可讓工作頁那一列還存在

頁: [1]

麻辣家族討論版版為 麻辣學園 網站成員  由 昱得資訊工作室 © Since 1993 所提供