vba如下代码为何不显示后面序号,如图,请帮忙改正。
如下代码是B列不为空,C列从大到小显示序号,但后面有一部分序号不显示,错在哪?Sub序号()DimiAsInteger,jAsIntegerj=Application.W...
如下代码是B列不为空,C列从大到小显示序号,但后面有一部分序号不显示,错在哪?
Sub 序号()
Dim i As Integer, j As Integer
j = Application.WorksheetFunction.CountA(Sheet1.Range("B2:B30"))
For i = 2 To j
If Range("b" & i) <> "" Then
Range("c" & i) = j
j = j - 1
End If
Next i
End Sub 展开
Sub 序号()
Dim i As Integer, j As Integer
j = Application.WorksheetFunction.CountA(Sheet1.Range("B2:B30"))
For i = 2 To j
If Range("b" & i) <> "" Then
Range("c" & i) = j
j = j - 1
End If
Next i
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询