|
本帖最后由 ruhong18 于 2020-1-4 10:14 编辑
Sub 删除指定列()
Dim colNames
Dim i%, j%
colNames = Array("单号","客户", ) '添加指定的列名
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Len(Cells(1, i)) = 0 Then GoTo ghb
For j = 0 To UBound(colNames)
If Cells(1, i) = colNames(j) Then
Columns(i).Delete
Exit For
End If
Next
ghb:
Next
End Sub
|
|