Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
This doesn't work (it runs, but gives a result of 0 instead of the correct answer) when the user responds with 54161 (for example): Sub HowMany() Dim res As String Dim myinput As String myinput = InputBox("Enter the CPT Code...") res = Evaluate("=CountIf(Ops, myinput)") MsgBox (res) End Sub This does work: Sub HowMany() Dim res As String Dim myinput As String 'myinput = InputBox("Enter the CPT Code...") res = Evaluate("=CountIf(Ops, 54161)") MsgBox (res) End Sub I've searched this group and googled, but can't find why or how to get the VBA for COUNTIF to accept a variable as a criteria.... Any idea how to get around this ? Thanks again C L Snyder |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
More than one variable for Countif | Excel Worksheet Functions | |||
countif using two variable | Excel Discussion (Misc queries) | |||
countif variable criteria | Excel Discussion (Misc queries) | |||
Countif using format criteria not number criteria? | Excel Worksheet Functions | |||
Countif using format criteria....not number criteria? | Excel Worksheet Functions |