![]() |
|
#10
|
||||
|
||||
|
…or write your own user-defined function. See B6 in the attached.
=CountOfRowsWithNOrMoreConsecutiveXs(A1:G4,5) (Case insensitive) Code:
Function CountOfRowsWithNOrMoreConsecutiveXs(myRange, N)
Vals = myRange.Value
For rw = 1 To UBound(Vals)
ThisRowCount = 0
For colm = 1 To UBound(Vals, 2)
If InStr(1, UCase(Vals(rw, colm)), "X") > 0 Then ThisRowCount = ThisRowCount + 1 Else ThisRowCount = 0
If ThisRowCount >= N Then
RowCount = RowCount + 1
Exit For
End If
Next colm
Next rw
CountOfRowsWithNOrMoreConsecutiveXs = RowCount
End Function
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
how to copy different text from word into excel on consecutive rows
|
mihnea96 | Word VBA | 4 | 05-08-2017 12:09 PM |
| Counting Consecutive Periods In Rows Using Numbers | Yaaseen23 | Excel | 18 | 03-24-2017 11:15 AM |
Counting rows with a macro?
|
Jennifer Murphy | Word Tables | 1 | 08-23-2016 03:00 PM |
Counting table rows in a page
|
RavenSuzumiya | Word Tables | 1 | 06-09-2016 03:38 PM |
Problem with consecutive Figure number placements
|
Ian A King | Word | 2 | 05-11-2015 10:13 PM |