Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Rick, Perfect, I just couldn't get the syntax right. I kept trying to use Selection.rows.count and that just brought back all rows in the selected area. Thanks, and I'll try to be more precise and include code next time. Thanks -- Chris Freeman IT Project Coordinator "Rick Rothstein" wrote: It's hard to say how you should add this to your code as you didn't post any code (which is why I gave you the general-type answer I did. Here is a made-up example that may help you see how to integrate it into your code. RangeTotalVariable = WorksheetFunction.Sum(Range("A1:A100")) CountNumbersVariable = WorksheetFunction.Count(Range("A1:A100")) CountTextCellsVariable = WorksheetFunction.CountA(Range("A1:A100")) Of course, these constructions can be more complicated than I have shown depending on what you are trying to do. -- Rick (MVP - Excel) "Chris Freeman" wrote in message ... Rick, I have no idea what you just said. I know a little programming but, what is WorksheetFunction Property? I items listed when I press F2 in the code window, but how do I add this to my code? -- Chris Freeman IT Project Coordinator "Rick Rothstein" wrote: Look at the WorksheetFunction Property (of the Application object)... the count and sum functions are all available through it. -- Rick (MVP - Excel) "Chris Freeman" wrote in message ... I have a sheet that I need to count the number of items in a column and also sum them. I can add a formula to cell, collect the values to a variable, then clear the cell, but I was trying to figure out a more elegant internal code. I wanted to caputure the number of items in the column without looping. problem is that some rows are blank, and Selection.Rows.Count brings back all rows. Thanks --------------------------------- Chris Freeman IT Project Coordinator |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Public Variable into Sheet Sub Functions | Excel Programming | |||
How to set up variable data ranges in nested functions | Excel Worksheet Functions | |||
Variable range addresses for use in array functions | Excel Discussion (Misc queries) | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
are variable table-array names in functions possible? | Excel Discussion (Misc queries) |