Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Match data, count data and report to diffrent sheet. | Excel Discussion (Misc queries) | |||
I need to count data in one colum based on data in another column | Excel Worksheet Functions | |||
Data count with two worksheets | Excel Worksheet Functions | |||
pivot table+put unique data in 'row area'+count of items in 'data area' | Excel Programming | |||
Count data per row and more ? | Excel Programming |