Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Count number of appearance in a cell

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Count number of appearance in a cell

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





wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Count number of appearance in a cell

=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





wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count x2 Appearance of Numeric Value in any Row Sam via OfficeKB.com Excel Worksheet Functions 9 April 2nd 08 02:02 PM
Count the number of appearance within a cell Lucy Excel Worksheet Functions 13 March 9th 08 08:56 PM
Count & Sum Consecutive (2x) appearance of Specific Numeric Values Sam via OfficeKB.com Excel Programming 7 February 12th 07 03:54 AM
Count & Sum Consecutive (2x) appearance of Specific Numeric Values Sam via OfficeKB.com Excel Worksheet Functions 2 February 5th 07 02:44 PM
number formats that allow you to format the appearance of negativ. jassmon Charts and Charting in Excel 1 January 15th 05 09:04 AM


All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"