I am getting a different RowNumber whenever I run my code.
Dim idRowCount As Long
idRowCount = Worksheets("MasterFile").Range("B:B").Cells.SpecialCells(xlCellTypeConstants).Count
Range("R2").Copy
Range("R3:R" & idRowCount).PasteSpecial xlPasteFormulas
The total RowCount should be 325,000 but sometimes it only paste the formulas up to 180,000 or 150,000 cell row.
Is there anything wrong with my code or declaration?
I have already tried to paste the count value on a Range of cell and it gives the right number of constant value 325,000. I also tried to temporarily replace the variable 'idRowCount' with the number 300,000 but it returns(paste) on different row number.