I have written a simple code to illustrate my predicament.
Sub test() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets(\"Sheet1\") Dim k As Lon
CountRows = ThisWorkbook.Worksheets(1).Range("A:A").Cells.SpecialCells(xlCellTypeConstants).Count