Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorksheetFunction.CountA - Excel 2000, Please help
Hello,
I am having some difficulty with this function...can someone assist? I am trying to count the number of non-empty (text data) cells in a given array of cells. Worksheetfunction.counta does not return the right number of cells with text when there is data in column 42 or 46 or 50. But seems to work okay upto column 38. The code I use is provided below. When I execute the code in stepwise mode, it shows data in columns 18,22,26,30,34 and 36. But when the cursor is put on the cells(Row,38, 42, 46, 50)...it does not show they contain values even though they do contain data. Is there error in the code? With Sheets("Data") For Row = 4 To lastr c = WorksheetFunction.CountA(.Cells(Row, 18), .Cells(Row, 22), _ .Cells(Row, 26), .Cells(Row, 30), .Cells(Row, 34), .Cells(Row, 38) _ .Cells(Row, 42), .Cells(Row, 46), .Cells(Row, 50)) ' # items. Thanks Ally |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorksheetFunction.CountA - Excel 2000, Please help
On Tue, 19 Apr 2005 16:41:31 -0700, "microsoft" wrote:
Hello, I am having some difficulty with this function...can someone assist? I am trying to count the number of non-empty (text data) cells in a given array of cells. Worksheetfunction.counta does not return the right number of cells with text when there is data in column 42 or 46 or 50. But seems to work okay upto column 38. The code I use is provided below. When I execute the code in stepwise mode, it shows data in columns 18,22,26,30,34 and 36. But when the cursor is put on the cells(Row,38, 42, 46, 50)...it does not show they contain values even though they do contain data. Is there error in the code? With Sheets("Data") For Row = 4 To lastr c = WorksheetFunction.CountA(.Cells(Row, 18), .Cells(Row, 22), _ .Cells(Row, 26), .Cells(Row, 30), .Cells(Row, 34), .Cells(Row, 38) _ .Cells(Row, 42), .Cells(Row, 46), .Cells(Row, 50)) ' # items. Thanks Ally Could it be the lack of a comma after .Cells(Row, 38) ??? --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 WorksheetFunction Functions run-time error | Setting up and Configuration of Excel | |||
COUNTA Function not working =COUNTA(C3:C69,"NH") | Excel Worksheet Functions | |||
Create macro to download access 2000 table to excel 2000 spreadsheet | Excel Programming | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming | |||
Using Excel WorksheetFunction.Mode function in Access VBA | Excel Programming |