- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 8# billchenfantasy
第17行的Next要往前放- Sub ex()
-
- Dim Rng As Range, C As Range
- ar = Array("PLAN_NO", "PLAN_DAT")
- For Each C In Rows(1).SpecialCells(xlCellTypeConstants)
- n = 0
- For Each a In ar
- If InStr(UCase(C), UCase(a)) > 0 Then
- n = n + 1
- End If
- Next
- If n = 0 Then
- If Rng Is Nothing Then
- Set Rng = C
- Else
- Set Rng = Union(Rng, C)
- End If
- End If
- Next
- Rng.EntireColumn.Delete
- End Sub
複製代碼 |
|