VBE 调试器不断给我
1004 error (Application-defined or object-defined error)
在线的 "Worksheets("General").Cells(cur_index, 2).Value = cur_time"
或我尝试真正修改单元格值的任何尝试。
该函数是从同一工作表中的单元格调用的。但是当我打字的时候?
在即时窗口中的活动表,没有任何显示。怎么了?
有人可以告诉我如何解决它以及有什么问题吗?谢谢。
更新:这是我的代码的一部分,我的代码开头确实有明确的选项。
Function collectdata(cur_time)
Dim row_num As Integer, start_index As Integer, end_index As Integer, cur_index As Integer, col_num As Integer
row_num = 1
start_index = total_record * num_it + 21
end_index = start_index + total_record - 1
Dim rg As String
rg = "A" & start_index & ":A" & end_index
On Error GoTo err1
If cur_time > 0 And num_it < 10 Then
cur_index = cur_time + 1200 * num_it
Worksheets("General").Cells(cur_index, 2).Value = cur_time
Worksheets("General").Range(rg).Value = num_it + 1
For col_num = 3 To 12
Worksheets("General").Cells(cur_index, col_num).Value = Cells(7, col_num).Value
Next col_num
ElseIf cur_time = 1200 Then
num_it = num_it + 1
End If
err1:
Debug.Print Err.Description
End Function