Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variable in WorksheetFunction
Can you see what I am doing wrong here.
Sub CntIf() Dim myrng As Range Sheets("Node Data").Activate Cells(1, counter + 2).Value = "Total Leaks per " & Ldb Set myrng = Sheets(Ldb).Range("B2:B" & rwct) Range(Cells(2, counter + 2), Cells(85, counter + 2)) = Application.WorksheetFunction.CountIf(myrng, "$A$2:$A$85") End Sub This does put values in the range (Cells(2, counter + 2), Cells(85, counter + 2)) , but they are all 0's, not the correct count. TIA Mike F |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WorksheetFunction with VBA | Excel Discussion (Misc queries) | |||
Max WorksheetFunction | Excel Programming | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming | |||
WorksheetFunction | Excel Programming | |||
WorksheetFunction | Excel Programming |