|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 okzmz001 于 2018-9-30 13:41 编辑
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Or Target.Row < 4 Then Exit Sub
For r = [B65536].End(xlUp).Row To 4 Step -1
If Cells(r, "B") <> "" Then
m = Application.CountA(Range("B4:B" & r))
Cells(r, "B").Offset(0, -1) = m 'Cells(r, "B").Offset(0, -1) = n + 464907开始的序号
Else
Cells(r, "B").EntireRow.ClearContents
End If
Next
[B65536].End(xlUp).Offset(1, 0).Resize(65536 - [B65536].End(xlUp).Row, 1).EntireRow.ClearContents
End Sub
|
|