Dim k%: k = 1 Do While Cells(k, 1) <> "" if Cells(k, 1) <> "" then Rows(k).Delete Shift:=xlUp else k=k+1 end if Loop
热心网友时间:2024-11-05 18:31
Dim k%
For k = 1 To [A65536].End(xlUp).Row If Cells(k, 1) = "" Then Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp k = k - 1 End If Next '''''''''''''''''''' 你的代码直接对K加,并且不管k等于多少,代码最终都要走到删除的那一块,所以 一定会删除东西,但是不一定是删除了正确的东西