Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CntIf()
Dim Ldb, rwct, counter Dim myrng As Range Sheets("Node Data").Activate If Range("B2").Value = "" Then Cells(1, counter + 2).Value = "Total Leaks per " & Ldb Set myrng = Sheets(Ldb).Range("$B$2:$B$" & rwct) Range(Cells(2, counter + 2), Cells(85, counter + 2)) = Application.WorksheetFunction.CountIf(myrng, "$A$2:$A$85") 'This does not work Range(Cells(2, counter + 3), Cells(85, counter + 3)).Formula = "=COUNTIF(LAFQ403!$B$2:$B$568,$A$2:$A$85)" 'This works End If End Sub How do I get the variables to work in the WorksheetFunction? The variable values at these lines a Ldb = "LAFQ403" rwct = 568 counter = 0 TIA Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WorksheetFunction help | Excel Discussion (Misc queries) | |||
WorksheetFunction with VBA | Excel Discussion (Misc queries) | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming | |||
WorksheetFunction | Excel Programming | |||
worksheetfunction | Excel Programming |