Maybe capture the visible cell values in a pair of Variants, and then compute Rsq from those:
![]()
Dim vX as Variant, vY as Variant, dR as Double vX = Sheets("Data").Range("aj3:aj1003").SpecialCells(xlCellTypeVisible).Value vY = Sheets("Data").Range("ak3:ak1003").SpecialCells(xlCellTypeVisible).Value R = WorksheetFunction.Rsq(vY, vX)
Bookmarks