我写一个VBA宏来计算的Excel sheet2
行数文件Excel文件中VBA
Dim cnt As Integer
Dim i As Integer
cnt = Range("Sheet2").Rows.Count ' giving error at this row
For i = 2 To cnt
t1 = "A" + CStr(i)
t2 = "B" + CStr(i)
Next i
但它给错误:
Method 'Range' of object '_global' failed
您会得到什么错误? –
我得到这个错误(方法'范围'的对象'_global'失败 –