Hi Jamal,
Quote:
Thank you Colin for the contribution.
i didn't find any problem
|
If you select all of the cells on the sheet at once you will get a runtime error. It's a small detail, but it can easily happen if someone clicks on the square as indicated in the screenshot I've attached.
It's because the Range.Count property was originally designed for pre-2007 worksheets which were smaller. Specifically, the Range.Count property returns a 32-bit Long Integer which can hold a maximum value of 2,147,483,647, but a worksheet in a 2007/10 format file has 17,179,869,184 cells, which is too large to be held in a Long Integer type.
When the gridsize increased in the Excel 2007 release, it was accompanied by a new Range.CountLarge property which can handle the larger grid.