From: ppeer on 10 Feb 2010 14:45 Hi p45cal, Column D with the numbers (see OP) also contains cells with the word; "nvt". Using the average function in the worksheet itself results in the expected result: ignore those cells with nvt. But using application.worksheetfunction.average(etc....) in vba trows the error; "Unable to get the average property of the worksheet funation class, error 1004". Only using numbers in each cell of the range does give the expected result. I also tried empty cells instead of nvt, but then the average function also results in an error. I hope this is of any help. Peter
From: ppeer on 11 Feb 2010 16:14 p45cal, thanks very much I tested it and it works fast and clean! It's a real turbocharger. Indeed I want to exclude strings and blanks from the calc, although my input cells are never blank, so no further issue here: this code does just that. best rgards ppeer
First
|
Prev
|
Pages: 1 2 Prev: Excel 2007 VBA shape fill colour problem Next: Excel 2003 VBA Phantom Breakpoints |