View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default 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