yuliwei0001 wrote: 可是都會跳行能幫忙看看那裡錯了.(新手請見諒) Dim i As Integer
For i = 1 To 100
If Cells(i, 3) = "" Then Range(i & ":" & i).Delete End If Nextt...(恕刪)
因為刪掉一列後,下一列會上移,下一次迴圈 i+1 ,所以會跳行
Sub test() Dim delrow As String, lastrow As Integer lastrow = Sheets("工作表1").Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To lastrow If Cells(i, 3) = "" Then delrow = delrow & i & ":" & i & "," Next i If delrow = "" Then Exit Sub Range(Left(delrow, Len(delrow) - 1)).Delete Shift:=xlUp Cells(1, 1).Select End Sub