View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default excel b74=b74+1 when b4-b54 ="Y"

Hi lisa_p -

For an instantaneous count, you could use the following formula in cell B74:

=COUNTIF(B4:B54,"Y")

If you want to add counts the count already in cell B74, you could try the
following VB procedu

Sub lisa_p()
Range("B74") = Range("B74") + _
WorksheetFunction.CountIf(Range("B4:B54"), "Y")
End Sub

--
Jay

"lisa_p" wrote:

i want to add 1 to b74 each time any cell b4-b54 is equal to "Y".