#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default count data

if and if only two difrent data are found in cells on the same raw will be
counted if not will move to the next raw and so on

like the word "window" and the word "open" are found on the same raw it will
be counted if not it wil move to the next raw and so on how can it be done

then ill get the number of times that these data were found togather in
single raw in the data sheet
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default count data

Hi,
Something along these lines ....

Sub x()

Dim r As Long
Dim rng As Range

For r = 2 To 10 ' Loop through rows .....
lastcol = Cells(r, Columns.Count).End(xlToLeft).Column
Set rng = Range(Cells(r, 1), Cells(r, lastcol))
If Application.CountIf(rng, "window") 0 And Application.CountIf(rng,
"open") Then
MsgBox "Add my code"
' increment your count ....
End If
Next r

End Sub

HTH

"diesel" wrote:

if and if only two difrent data are found in cells on the same raw will be
counted if not will move to the next raw and so on

like the word "window" and the word "open" are found on the same raw it will
be counted if not it wil move to the next raw and so on how can it be done

then ill get the number of times that these data were found togather in
single raw in the data sheet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default count data

Slight error ...

If Application.CountIf(rng, "window") 0 And Application.CountIf(rng,
"open") 0 Then


"Toppers" wrote:

Hi,
Something along these lines ....

Sub x()

Dim r As Long
Dim rng As Range

For r = 2 To 10 ' Loop through rows .....
lastcol = Cells(r, Columns.Count).End(xlToLeft).Column
Set rng = Range(Cells(r, 1), Cells(r, lastcol))
If Application.CountIf(rng, "window") 0 And Application.CountIf(rng,
"open") Then
MsgBox "Add my code"
' increment your count ....
End If
Next r

End Sub

HTH

"diesel" wrote:

if and if only two difrent data are found in cells on the same raw will be
counted if not will move to the next raw and so on

like the word "window" and the word "open" are found on the same raw it will
be counted if not it wil move to the next raw and so on how can it be done

then ill get the number of times that these data were found togather in
single raw in the data sheet

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
Match data, count data and report to diffrent sheet. George W. W. Excel Discussion (Misc queries) 7 March 2nd 09 02:54 AM
I need to count data in one colum based on data in another column LG Excel Worksheet Functions 1 June 13th 06 02:41 PM
Data count with two worksheets CallCtrHelp Excel Worksheet Functions 1 February 9th 06 09:28 AM
pivot table+put unique data in 'row area'+count of items in 'data area' bubz Excel Programming 0 August 31st 04 04:22 AM
Count data per row and more ? Jumbo[_2_] Excel Programming 3 November 16th 03 05:33 PM


All times are GMT +1. The time now is 09:07 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"