From my testing, if there are no numeric cells in any of those columns AVERAGE will return the #DIV/0 error if in a cell.
In your use, with VBA, this results in the "Unable to get Average property" error message.
Application.Worksheet.Average will result in a run time error.
Application.Average will return an error value (but will then crash because RngAvrg1 is data type Long which is a type mismatch with the data type Error that it will return)
If you declare RngAvrg1 as Variant and use Application.Average rather than Application.Worksheet.Average that should fix things.
or you could replace the whole thing with
|
Bookmarks