Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
Hi,
I get an Expected; end of statement error with this code. The word 'Missed' is highlighted as the point of the error. Private Sub CommandButton8_Click() Range ("L2").Formula = "=COUNTIF(E2:E25,"Missed code date")" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
Quote marks that are internal to a string constant must be doubled up so
that VB knows where the string constant begins and ends. Try it this way... Range("L2").Formula = "=COUNTIF(E2:E25,""Missed code date"")" -- Rick (MVP - Excel) "ChipButtyMan" wrote in message ... Hi, I get an Expected; end of statement error with this code. The word 'Missed' is highlighted as the point of the error. Private Sub CommandButton8_Click() Range ("L2").Formula = "=COUNTIF(E2:E25,"Missed code date")" End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
try double quotes around "Missed code date".......... it's reading it
as the end of the code. E2:#25,""Missed code date"")" hope that helps :) susan On Oct 20, 2:22*pm, ChipButtyMan wrote: Hi, * * *I get an Expected; end of statement error with this code. The word 'Missed' is highlighted as the point of the error. Private Sub CommandButton8_Click() Range ("L2").Formula = "=COUNTIF(E2:E25,"Missed code date")" End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
To include quotation marks within a string, you need to double them (or
replace them with CHR(34)): Try: Range ("L2").Formula = "=COUNTIF(E2:E25,""Missed code date"")" In article , ChipButtyMan wrote: Hi, I get an Expected; end of statement error with this code. The word 'Missed' is highlighted as the point of the error. Private Sub CommandButton8_Click() Range ("L2").Formula = "=COUNTIF(E2:E25,"Missed code date")" End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
Hi,
You need to double-up on internal qiotes, try this Range("L2").Formula = "=COUNTIF(E2:E25,""Missed code date"")" Mike "ChipButtyMan" wrote: Hi, I get an Expected; end of statement error with this code. The word 'Missed' is highlighted as the point of the error. Private Sub CommandButton8_Click() Range ("L2").Formula = "=COUNTIF(E2:E25,"Missed code date")" End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does this COUNTIF code not work
Thanks very much everyone.
Much appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COUNTIF doesn't work | Excel Discussion (Misc queries) | |||
Will countif work? | Excel Programming | |||
How to get Countif to work this out? | Excel Worksheet Functions | |||
Countif does not work | Excel Worksheet Functions | |||
CountIf should work across sheets | Excel Worksheet Functions |