請教前輩
依H欄為〞空格〞或〞字串的字數大於12〞,則刪除該列。(字串 123456ABCDE12)
參照本論壇文獻,修訂但無法刪除,敬請前輩指點:
Sub yy()
Dim AA&, i&, myi As Range
With Sheets (“TEST”)
AA = Range("A65536").End(xlUp).Row
For i = 6 To AA
If Len(Trim(Cells(i, 8).Value).Value) > 10 Or Cells(i, 8) = "" Then
If myi Is Nothing Then
Set myi = Cells(i, 8)
Else
Set myi = Union(myi, Cells(i, 8))
End If
End If
Next
If Not myi Is Nothing Then myi.EntireRow.Delete
End With
End Sub作者: GBKEE 時間: 2011-3-2 21:03
謝謝前輩指導
問題已解決了
另請教可以改善下述多重條件" Or "之表示方式?
---------
For Each A In Range("A6:A65536").SpecialCells(xlCellTypeConstants)
If A = "中部" Or A = "借貸" Or A.Offset(, 4) = "" Or A.Offset(, 11) = "林二" Or A.Offset(, 12) = "外住" Or A.Offset(, 12) = "外地" Then
--------作者: luhpro 時間: 2011-4-30 05:01