【VBA】判断某单元格为空,删除所在行,光标上移
Sub xuanzexx() Dim i As Integer For i = 135 To 4 Step -1 If Cells(i, 11) = "" Then Rows(i).Select Selection.Delete Shift:=xlUp End If Next i End Sub
Sub xuanzexx() Dim i As Integer For i = 135 To 4 Step -1 If Cells(i, 11) = "" Then Rows(i).Select Selection.Delete Shift:=xlUp End If Next i End Sub
Sub 去重()//Dim AA11 As StringDim i As IntegerFor i = 216 To 1 Step -1 If Cells(i, 2) = Cells(i - 1, 2) Then Rows(i).Delete End IfNextEnd Sub
Sub Sswr()Dim i As Integer, j As IntegerFor i = 2 To 16 For j = 2 To 4 Cells(i, j) = Application.WorksheetFunction.Round(Cells(i, j), 2) Next j Next iMsgBox "OK!!"End Sub这里为什么不用自带的round()函数,而是调用excel自