返回列表 上一主題 發帖

[發問] 刪除小計為0的欄

Sub TEST()
Dim i&, xU As Range
For i = 9 To Cells(1, Columns.Count).End(xlToLeft).Column
    If Cells(1, i) = 0 Then
       If xU Is Nothing Then Set xU = Cells(1, i) Else Set xU = Union(xU, Cells(1, i))
    End If
Next i
If Not xU Is Nothing Then xU.EntireColumn.Delete
End Sub

TOP

        靜思自在 : 盡多少本份,就得多少本事。
返回列表 上一主題