PC Review


Reply
Thread Tools Rate Thread

Count number of appearance in a cell

 
 
daronnebonneau@gmail.com
Guest
Posts: n/a
 
      22nd Jul 2009
Hi,

I would like to count how many times a certain word appears in a cell.
The cell is supposed to show a word "Q", and disappear if it doesn't
meet my if formula under the cell.
since the cell is linked to DDE, I will show and disappears very
often.
And I would like to count how many times does the" Q" appears during a
certain time period.
Does anyone have idea how to write logic ?

Sub test()
Dim Count As Interger



 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      22nd Jul 2009
does the dde force a calculate? if so, you can trap that event and update a
counter

right click the sheet's tab and select View Code
in the module paste this code, then change QCELL and COUNTER for the actual
cell addresses:


Option Explicit
Private Sub Worksheet_Calculate()
If Range("QCELL") = "Q" Then Range("COUNTER").Value = Range("COUNTER").Value
+ 1
End Sub





<(E-Mail Removed)> wrote in message
news:97b7c7bc-8deb-4dc7-b36e-(E-Mail Removed)...
> Hi,
>
> I would like to count how many times a certain word appears in a cell.
> The cell is supposed to show a word "Q", and disappear if it doesn't
> meet my if formula under the cell.
> since the cell is linked to DDE, I will show and disappears very
> often.
> And I would like to count how many times does the" Q" appears during a
> certain time period.
> Does anyone have idea how to write logic ?
>
> Sub test()
> Dim Count As Interger
>
>
>

 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      22nd Jul 2009
=SUM(LEN(A1:A3)-LEN(SUBSTITUTE(A1:A3,"Q","")))
Enter with Ctrl+Shift+Enter, not just Enter.
HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Patrick Molloy" wrote:

> does the dde force a calculate? if so, you can trap that event and update a
> counter
>
> right click the sheet's tab and select View Code
> in the module paste this code, then change QCELL and COUNTER for the actual
> cell addresses:
>
>
> Option Explicit
> Private Sub Worksheet_Calculate()
> If Range("QCELL") = "Q" Then Range("COUNTER").Value = Range("COUNTER").Value
> + 1
> End Sub
>
>
>
>
>
> <(E-Mail Removed)> wrote in message
> news:97b7c7bc-8deb-4dc7-b36e-(E-Mail Removed)...
> > Hi,
> >
> > I would like to count how many times a certain word appears in a cell.
> > The cell is supposed to show a word "Q", and disappear if it doesn't
> > meet my if formula under the cell.
> > since the cell is linked to DDE, I will show and disappears very
> > often.
> > And I would like to count how many times does the" Q" appears during a
> > certain time period.
> > Does anyone have idea how to write logic ?
> >
> > Sub test()
> > Dim Count As Interger
> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Count the number of cell based on the value of certain cell Max Microsoft Excel New Users 2 25th Sep 2008 07:59 AM
RE: Count the number of cell based on the value of certain cell Ron@Buy Microsoft Excel New Users 0 24th Sep 2008 07:12 AM
Count the number of appearance within a cell Lucy Microsoft Excel Worksheet Functions 13 9th Mar 2008 08:56 PM
count each cell that have a number and take that number and count. =?Utf-8?B?Vmljaw==?= Microsoft Excel Misc 3 19th May 2006 01:51 AM
Count number of times a specific number is displayed in a cell ran =?Utf-8?B?c3Vicw==?= Microsoft Excel Worksheet Functions 1 27th Jun 2005 05:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 AM.