请教~~给A列编号的代码运行不起作用
我要实现给A列编号,如果B3不为空,则A3=1,否则A3=2,A4=3...... 但运行如下代码后不起任何作用,也不不报错,哪里不对啊?求指导,谢谢Sub 编号()
Dim i%, d%
a = Application.WorksheetFunction.CountA(Range("O2:HG2"))
For d = 3 To rownum Step 1
For i = 1 To a - 1
If Cells(d, b) <> "" Then
Cells(d, a) = 1
Else
Cells(d, a) = i+1
End If
Next i
Next d
End Sub