|
发表于 2016-6-20 10:48
|
显示全部楼层
本楼为最佳答案
本帖最后由 suye1010 于 2016-6-20 10:49 编辑
- Sub DelCol()
- Dim i As Integer, j As Integer, m As Integer, Arr, B As Boolean
- Arr = Range("K1").CurrentRegion
- For m = UBound(Arr, 2) To 1 Step -1
- B=False
- For i = UBound(Arr) To 2 Step -1
- If B = True Then Exit For
- For j = i - 1 To 2 Step -1
- If (Arr(j, m)) = Arr(i, m) And Arr(j - 1, m) = Arr(i, m) And Arr(i, m) <> "" Then
- Cells(1, m + 10).EntireColumn.Delete
- B = True
- Exit For
- End If
- Next j
- Next i
- Next m
- End Sub
复制代码 |
|