这是因为这不是编写这段代码的有效方法,还是像这样在 excel 上工作太慢了?我在 Windows 8 64 位中使用 excel 2007。我的办公室笔记本是一个非常更新的笔记本,里面装有最新的 I5 cpu。这是代码:
Private Sub CommandButton1_Click()
Sheets("data").Select
For rcounter = 2 To 45752
For xcounter = 26 To 50
For ycounter = 2 To 414
If (Cells(1, xcounter) = Cells(rcounter, 4)) Then
If (CInt(Cells(ycounter, 25)) = CInt(Cells(rcounter, 10))) Then
Cells(ycounter, xcounter).Value = Cells(ycounter, xcounter).Value + 1
End If
End If
Next ycounter
Next xcounter
Next rcounter
End Sub