每当我运行代码时,我都会得到一个不同的RowNumber。
Dim idRowCount As Long
idRowCount = Worksheets("MasterFile").Range("B:B").Cells.SpecialCells(xlCellTypeConstants).Count
Range("R2").Copy
Range("R3:R" & idRowCount).PasteSpecial xlPasteFormulas
RowCount总数应为325,000,但有时仅将公式粘贴至最多180,000或150,000个单元格行。
我的代码或声明有什么问题吗?
我已经尝试过将计数值粘贴到“单元格范围”上,并且它给出正确的常数值325,000。 我还尝试将变量'idRowCount'临时替换为数字300,000,但它在不同的行号上返回(粘贴)。