这个代码非常好,但在实际运行时,还有一点问题,当数据达到三万行后,鼠标无论点到那个单元格,都要等待几秒时间,不能立即反应,能不能让代码再快一点
追答用这个试试:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rownumber As Long
On Error Resume Next
Application.ScreenUpdating = False
For rownumber = Cells(70000, 1).End(xlUp).Row To Cells(70000, 3).End(xlUp).Row
If Cells(rownumber, 3) "" Then Cells(rownumber, 1) = rownumber - 2
Next
Application.ScreenUpdating = True
End Sub