对象“_Global”的方法“范围”错误失败 [英] Error on Method 'Range' of object '_Global' failed
问题描述
任何想法? (我使用完成作为按钮,它所做的只是黑色的一个单元格)。我希望,当我这样做的时候会重置并转到下一列。
Sub GoGo()
公开GoGo As Boolean
GoGo = True
End Sub
Sub Runn()
Dim lastrow As Long,i As Long
For i = 23 To 32
DoEvents
如果GoGo = True则
如果Cells(i,1)<> 0然后
范围(B5)Value = Cells(i,2).Value
Range(E5)。Value = Cells(i,3).Value
Range(E11)。Value = Range(C33)。value
Application.Run(Realcount)
Application.Run(Realcount2)
结束如果
结束如果
下一个i
End Sub
你不能做Range(i,2)或Range (i,3)。你的意思是细胞(i,2)?
I am running a timer. I want the timer to count down the count up. This all works. However, the timer needs to go through a bunch of times in different rows but should NOT move to the next time until a button is pressed. This will allow me to extract times that went over the countdown.
Any ideas? (I am using the finish as a button, all it does is black a cell). I was hoping that when I did that the times would reset and go to the next column.
Sub GoGo()
Public GoGo As Boolean
GoGo = True
End Sub
Sub Runn()
Dim lastrow As Long, i As Long
For i = 23 To 32
DoEvents
If GoGo = True Then
If Cells(i, 1) <> 0 Then
Range("B5").Value = Cells(i, 2).Value
Range("E5").Value = Cells(i, 3).Value
Range("E11").Value = Range("C33").Value
Application.Run ("Realcount")
Application.Run ("Realcount2")
End If
End If
Next i
End Sub
You can't do Range(i, 2) or Range(i, 3). Did you means Cells(i, 2)?
这篇关于对象“_Global”的方法“范围”错误失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!